Make sure the buffer padding is always cleared before looking for the next buffer

This commit is contained in:
Chris Robinson 2010-11-24 07:20:41 -08:00
parent 13ba253aec
commit bb13f7f234

View File

@ -642,6 +642,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
if(DataPosInt >= DataSize)
goto skipmix;
memset(&Data.p8[DataSize*Channels*Bytes], 0, BUFFER_PADDING*Channels*Bytes);
if(BufferListItem->next)
{
ALbuffer *NextBuf = BufferListItem->next->buffer;
@ -665,8 +666,6 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
ulExtraSamples);
}
}
else
memset(&Data.p8[DataSize*Channels*Bytes], 0, (BUFFER_PADDING*Channels*Bytes));
/* Figure out how many samples we can mix. */
increment = Source->Params.Step;