diff options
author | Chris Robinson <[email protected]> | 2011-10-04 22:35:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-10-04 22:35:01 -0700 |
commit | 9e11b0a8c6c521a0c8b4dc4ed7c05017a787ca62 (patch) | |
tree | e22d617043f71d0a4fdf15f915c5f8be92a477c1 | |
parent | 58619204531e0a918ee7a92d51cb7e1a127a1218 (diff) |
Fix maximum BufferSize calculation
-rw-r--r-- | Alc/mixer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 7196d6f8..231aa0fd 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -563,11 +563,11 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) DataSize64 += DataPosFrac+FRACTIONMASK; DataSize64 >>= FRACTIONBITS; DataSize64 += BufferPadding+BufferPrePadding; - DataSize64 *= FrameSize; + DataSize64 *= NumChannels; - BufferSize = (ALuint)((DataSize64 > STACK_DATA_SIZE) ? - STACK_DATA_SIZE : DataSize64); - BufferSize /= FrameSize; + BufferSize = (ALuint)((DataSize64 > STACK_DATA_SIZE/sizeof(ALfloat)) ? + STACK_DATA_SIZE/sizeof(ALfloat) : DataSize64); + BufferSize /= NumChannels; if(Source->lSourceType == AL_STATIC) { |