win32: fix xaudio2 mixing loop

This commit is contained in:
OV2 2013-03-26 15:06:36 +01:00
parent 9ac39c43a1
commit 231f4eea8f
1 changed files with 1 additions and 2 deletions

View File

@ -390,10 +390,8 @@ void CXAudio2::ProcessSound()
BYTE * curBuffer;
UINT32 availableSamples;
UINT32 availableBytes;
availableSamples = S9xGetSampleCount();
availableBytes = availableSamples * (Settings.SixteenBitSound ? 2 : 1);
while(availableSamples > singleBufferSamples && bufferCount < blockCount) {
curBuffer = soundBuffer + writeOffset;
@ -401,5 +399,6 @@ void CXAudio2::ProcessSound()
PushBuffer(singleBufferBytes,curBuffer,NULL);
writeOffset+=singleBufferBytes;
writeOffset%=sum_bufferSize;
availableSamples -= singleBufferSamples;
}
}