Clear all the old channel gains to 0 before setting them

This commit is contained in:
Chris Robinson 2013-05-20 00:02:47 -07:00
parent c693e649e6
commit 6aa722808e
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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];