From af3b5c23c846d261b1b81528007d659d2754af7b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 9 Sep 2012 04:27:47 -0700 Subject: Try to ensure mixing samples in multiples of 4 --- Alc/mixer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Alc') diff --git a/Alc/mixer.c b/Alc/mixer.c index e6cab3be..a7882c23 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -424,6 +424,11 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) BufferSize = (ALuint)((DataSize64+(increment-1)) / increment); BufferSize = minu(BufferSize, (SamplesToDo-OutPos)); + /* Some mixers like having a multiple of 4, so try to give that unless + * this is the last update. */ + if(OutPos+BufferSize < SamplesToDo) + BufferSize &= ~3; + SrcData += BufferPrePadding*NumChannels; for(i = 0;i < NumChannels;i++) { -- cgit v1.2.3