aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/distortion.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/distortion.c
parent713e9dd4cc5f0bbe396fae35282ec147a45a0974 (diff)
Pas the output device channel count to ALeffectState::process
Diffstat (limited to 'Alc/effects/distortion.c')
-rw-r--r--Alc/effects/distortion.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c
index 9474f3ae..7098cdf9 100644
--- a/Alc/effects/distortion.c
+++ b/Alc/effects/distortion.c
@@ -84,7 +84,7 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, ALCdevice *Devi
ComputeAmbientGains(Device, Slot->Gain, state->Gain);
}
-static ALvoid ALdistortionState_process(ALdistortionState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
+static ALvoid ALdistortionState_process(ALdistortionState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels)
{
const ALfloat fc = state->edge_coeff;
float oversample_buffer[64][4];
@@ -154,10 +154,10 @@ static ALvoid ALdistortionState_process(ALdistortionState *state, ALuint Samples
temps[it] = oversample_buffer[it][0] * state->attenuation;
}
- for(kt = 0;kt < MAX_OUTPUT_CHANNELS;kt++)
+ for(kt = 0;kt < NumChannels;kt++)
{
ALfloat gain = state->Gain[kt];
- if(!(gain > GAIN_SILENCE_THRESHOLD))
+ if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD))
continue;
for(it = 0;it < td;it++)