aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-04 06:57:58 -0700
committerChris Robinson <[email protected]>2014-07-04 06:57:58 -0700
commitf667782df2307ff480ccf85c3fa09dc5f6ceabdb (patch)
treef1598d40ef9f3c7780b4bc2c31a0e0716762aa93 /Alc
parent3f45c00779e90040508550b82f362e1e2e5abb5f (diff)
Set the 'valid' field when we have a valid buffer pointer
Diffstat (limited to 'Alc')
-rw-r--r--Alc/midi/fluidsynth.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c
index 582da06d..73d4c47b 100644
--- a/Alc/midi/fluidsynth.c
+++ b/Alc/midi/fluidsynth.c
@@ -156,7 +156,7 @@ static void FSample_Construct(FSample *self, ALfontsound *sound)
sample->origpitch = sound->PitchKey;
sample->pitchadj = sound->PitchCorrection;
sample->sampletype = getSampleType(sound->SampleType);
- sample->valid = 1;
+ sample->valid = !!sound->Buffer;
sample->data = sound->Buffer ? sound->Buffer->data : NULL;
sample->amplitude_that_reaches_noise_floor_is_valid = 0;
@@ -294,8 +294,6 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan
fluid_voice_t *voice;
ALsizei m;
- if(!STATIC_CAST(fluid_sample_t, sample)->data)
- continue;
if(!(key >= sound->MinKey && key <= sound->MaxKey && vel >= sound->MinVelocity && vel <= sound->MaxVelocity))
continue;