From d7987677ac5748576626b0ed7f47d2e607bb4e77 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 26 Nov 2010 15:51:13 -0800 Subject: Subtract the fractional position separately --- Alc/mixer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Alc/mixer.c b/Alc/mixer.c index b1ad0771..53ba4aca 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -855,8 +855,9 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) DataSize64 -= BufferPadding+BufferPrePadding; DataSize64 <<= FRACTIONBITS; DataSize64 -= increment; + DataSize64 -= DataPosFrac; - BufferSize = (ALuint)((DataSize64-DataPosFrac+(increment-1)) / increment); + BufferSize = (ALuint)((DataSize64+(increment-1)) / increment); BufferSize = min(BufferSize, (SamplesToDo-OutPos)); if(BufferSize == 0) { -- cgit v1.2.3