diff options
author | Chris Robinson <[email protected]> | 2014-11-07 03:43:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-07 03:43:33 -0800 |
commit | 3f7cb8392ea8b75754e5292f75fdfe50168ffc8e (patch) | |
tree | 16835b1c968d401684e4c73a9eeb386d5df89cfb /Alc/effects/chorus.c | |
parent | 713e9dd4cc5f0bbe396fae35282ec147a45a0974 (diff) |
Pas the output device channel count to ALeffectState::process
Diffstat (limited to 'Alc/effects/chorus.c')
-rw-r--r-- | Alc/effects/chorus.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 0dde134a..02887fde 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -203,7 +203,7 @@ DECL_TEMPLATE(Sinusoid) #undef DECL_TEMPLATE -static ALvoid ALchorusState_process(ALchorusState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE]) +static ALvoid ALchorusState_process(ALchorusState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels) { ALuint it, kt; ALuint base; @@ -223,17 +223,17 @@ static ALvoid ALchorusState_process(ALchorusState *state, ALuint SamplesToDo, co 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; |