diff options
author | Chris Robinson <[email protected]> | 2009-11-19 10:42:41 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-11-19 10:42:41 -0800 |
commit | 4565bdd7ceb21e424ea3266e8c191725f5c575db (patch) | |
tree | d4033a333d655562b0f7a65048e9e7fd14f897fe | |
parent | 5f3c07ca3b99ac2f555c7e49dbfcb479ed0a6df8 (diff) |
Make sure there's at least a one-sample delay for the echo's first tap
-rw-r--r-- | Alc/alcEcho.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 66710cc4..ea4af8dd 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -71,9 +71,9 @@ ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) // Use the next power of 2 for the buffer length, so the tap offsets can be // wrapped using a mask instead of a modulo - maxlen = (ALuint)(AL_ECHO_MAX_DELAY * Device->Frequency); - maxlen += (ALuint)(AL_ECHO_MAX_LRDELAY * Device->Frequency); - maxlen = NextPowerOf2(maxlen+1); + maxlen = (ALuint)(AL_ECHO_MAX_DELAY * Device->Frequency) + 1; + maxlen += (ALuint)(AL_ECHO_MAX_LRDELAY * Device->Frequency) + 1; + maxlen = NextPowerOf2(maxlen); if(maxlen != state->BufferLength) { @@ -100,7 +100,7 @@ ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffect *Ef ALuint frequency = Context->Device->Frequency; ALfloat lrpan, cw, a, g; - state->Tap[0].delay = (ALuint)(Effect->Echo.Delay * frequency); + state->Tap[0].delay = (ALuint)(Effect->Echo.Delay * frequency) + 1; state->Tap[1].delay = (ALuint)(Effect->Echo.LRDelay * frequency); state->Tap[1].delay += state->Tap[0].delay; |