summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-09 04:27:47 -0700
committerChris Robinson <[email protected]>2012-09-09 04:27:47 -0700
commitaf3b5c23c846d261b1b81528007d659d2754af7b (patch)
treeebae084c174229f059e1b9b4efaf7deb8b11ffb6
parent9f208417dfd082b2359bb233d5e726e76758562b (diff)
Try to ensure mixing samples in multiples of 4
-rw-r--r--Alc/mixer.c5
1 files changed, 5 insertions, 0 deletions
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++)
{