summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-20 00:02:47 -0700
committerChris Robinson <[email protected]>2013-05-20 00:02:47 -0700
commit6aa722808e63877a34736c75eea46c5696a0fc0e (patch)
tree5dfc35f9becc1eff72f38e2ce38dcd22dacf754b /Alc
parentc693e649e67b14d508a08a4a8cde191daa4596b0 (diff)
Clear all the old channel gains to 0 before setting them
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alcDistortion.c4
-rw-r--r--Alc/alcEqualizer.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/Alc/alcDistortion.c b/Alc/alcDistortion.c
index 0d8f9ce5..59ccca73 100644
--- a/Alc/alcDistortion.c
+++ b/Alc/alcDistortion.c
@@ -91,7 +91,9 @@ static ALvoid DistortionUpdate(ALeffectState *effect, ALCdevice *Device, const A
ALfloat cutoff;
ALfloat edge;
- for(it = 0; it < Device->NumChan; it++)
+ for(it = 0;it < MaxChannels;it++)
+ state->Gain[it] = 0.0f;
+ for(it = 0;it < Device->NumChan;it++)
{
enum Channel chan = Device->Speaker2Chan[it];
state->Gain[chan] = gain;
diff --git a/Alc/alcEqualizer.c b/Alc/alcEqualizer.c
index 2067c319..dffc431a 100644
--- a/Alc/alcEqualizer.c
+++ b/Alc/alcEqualizer.c
@@ -118,6 +118,8 @@ static ALvoid EqualizerUpdate(ALeffectState *effect, ALCdevice *Device, const AL
ALfloat gain = sqrtf(1.0f / Device->NumChan) * Slot->Gain;
ALuint it;
+ for(it = 0;it < MaxChannels;it++)
+ state->Gain[it] = 0.0f;
for(it = 0; it < Device->NumChan; it++)
{
enum Channel chan = Device->Speaker2Chan[it];