summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-10-04 22:35:01 -0700
committerChris Robinson <[email protected]>2011-10-04 22:35:01 -0700
commit9e11b0a8c6c521a0c8b4dc4ed7c05017a787ca62 (patch)
treee22d617043f71d0a4fdf15f915c5f8be92a477c1
parent58619204531e0a918ee7a92d51cb7e1a127a1218 (diff)
Fix maximum BufferSize calculation
-rw-r--r--Alc/mixer.c8
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)
{