From 817ca82e4bb166e17e3e5b707df01ba325725116 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 10 Jun 2013 05:57:27 -0700 Subject: Fix input and feedback in the echo effect --- Alc/effects/echo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index 29087439..6d6d70fb 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -78,8 +78,7 @@ static ALboolean ALechoState_deviceUpdate(ALechoState *state, ALCdevice *Device) void *temp; temp = realloc(state->SampleBuffer, maxlen * sizeof(ALfloat)); - if(!temp) - return AL_FALSE; + if(!temp) return AL_FALSE; state->SampleBuffer = temp; state->BufferLength = maxlen; } @@ -148,8 +147,9 @@ static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const // Apply damping and feedback gain to the second tap, and mix in the // new sample - smp = ALfilterState_processSingle(&state->Filter, temps[i][1]+SamplesIn[i]); + smp = ALfilterState_processSingle(&state->Filter, temps[i][1]+SamplesIn[i+base]); state->SampleBuffer[offset&mask] = smp * state->FeedGain; + offset++; } for(k = 0;k < MaxChannels;k++) -- cgit v1.2.3