aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-07 03:43:33 -0800
committerChris Robinson <[email protected]>2014-11-07 03:43:33 -0800
commit3f7cb8392ea8b75754e5292f75fdfe50168ffc8e (patch)
tree16835b1c968d401684e4c73a9eeb386d5df89cfb /Alc/effects/echo.c
parent713e9dd4cc5f0bbe396fae35282ec147a45a0974 (diff)
Pas the output device channel count to ALeffectState::process
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index d6c62a30..fd85bdb0 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -109,7 +109,7 @@ static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const AL
ComputeDirectionalGains(Device, pandir, gain, state->Gain[1]);
}
-static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
+static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels)
{
const ALuint mask = state->BufferLength-1;
const ALuint tap1 = state->Tap[0].delay;
@@ -138,17 +138,17 @@ static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const
offset++;
}
- for(k = 0;k < MAX_OUTPUT_CHANNELS;k++)
+ for(k = 0;k < NumChannels;k++)
{
ALfloat gain = state->Gain[0][k];
- if(gain > GAIN_SILENCE_THRESHOLD)
+ if(fabsf(gain) > GAIN_SILENCE_THRESHOLD)
{
for(i = 0;i < td;i++)
SamplesOut[k][i+base] += temps[i][0] * gain;
}
gain = state->Gain[1][k];
- if(gain > GAIN_SILENCE_THRESHOLD)
+ if(fabsf(gain) > GAIN_SILENCE_THRESHOLD)
{
for(i = 0;i < td;i++)
SamplesOut[k][i+base] += temps[i][1] * gain;