From f667782df2307ff480ccf85c3fa09dc5f6ceabdb Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 4 Jul 2014 06:57:58 -0700 Subject: Set the 'valid' field when we have a valid buffer pointer --- Alc/midi/fluidsynth.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Alc/midi/fluidsynth.c') 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; -- cgit v1.2.3