From 3f7cb8392ea8b75754e5292f75fdfe50168ffc8e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 7 Nov 2014 03:43:33 -0800 Subject: Pas the output device channel count to ALeffectState::process --- Alc/effects/flanger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc/effects/flanger.c') diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index e5a49a43..460bb866 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -203,7 +203,7 @@ DECL_TEMPLATE(Sinusoid) #undef DECL_TEMPLATE -static ALvoid ALflangerState_process(ALflangerState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE]) +static ALvoid ALflangerState_process(ALflangerState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels) { ALuint it, kt; ALuint base; @@ -223,17 +223,17 @@ static ALvoid ALflangerState_process(ALflangerState *state, ALuint SamplesToDo, break; } - for(kt = 0;kt < MAX_OUTPUT_CHANNELS;kt++) + for(kt = 0;kt < NumChannels;kt++) { ALfloat gain = state->Gain[0][kt]; - if(gain > GAIN_SILENCE_THRESHOLD) + if(fabsf(gain) > GAIN_SILENCE_THRESHOLD) { for(it = 0;it < td;it++) SamplesOut[kt][it+base] += temps[it][0] * gain; } gain = state->Gain[1][kt]; - if(gain > GAIN_SILENCE_THRESHOLD) + if(fabsf(gain) > GAIN_SILENCE_THRESHOLD) { for(it = 0;it < td;it++) SamplesOut[kt][it+base] += temps[it][1] * gain; -- cgit v1.2.3