diff options
author | Chris Robinson <[email protected]> | 2009-10-21 02:03:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-10-21 02:03:33 -0700 |
commit | d3ecbd75affa0c42290c24a1cd82019e89ea3461 (patch) | |
tree | 9f271a712fc98f518e2de1139f5065c67b17d569 /Alc/alcEcho.c | |
parent | 75b65ab2a29aa10a054974f443cc94ccf5e70f3e (diff) |
Clear the echo and delay lines even if the buffer doesn't change size
Diffstat (limited to 'Alc/alcEcho.c')
-rw-r--r-- | Alc/alcEcho.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 431fa08e..0c0f19ed 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -88,7 +88,7 @@ ALvoid EchoDestroy(ALeffectState *effect) ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) { ALechoState *state = (ALechoState*)effect; - ALuint maxlen; + ALuint maxlen, i; // Use the next power of 2 for the buffer length, so the tap offsets can be // wrapped using a mask instead of a modulo @@ -99,7 +99,6 @@ ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) if(maxlen != state->BufferLength) { void *temp; - ALuint i; temp = realloc(state->SampleBuffer, maxlen * sizeof(ALfloat)); if(!temp) @@ -108,9 +107,9 @@ ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) return AL_FALSE; } state->BufferLength = maxlen; - for(i = 0;i < state->BufferLength;i++) - state->SampleBuffer[i] = 0.0f; } + for(i = 0;i < state->BufferLength;i++) + state->SampleBuffer[i] = 0.0f; return AL_TRUE; } |