win32: WaveOut: Fix dumb mistake.

This commit is contained in:
Alias Letterman 2019-02-11 19:45:45 -06:00
parent ed3beae304
commit bb0a66b7f9
1 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ void CWaveOut::ProcessSound()
availableSamples = S9xGetSampleCount(); availableSamples = S9xGetSampleCount();
if (Settings.DynamicRateControl) if (Settings.DynamicRateControl && !Settings.SoundSync)
{ {
// Using rate control, we should always keep the emulator's sound buffers empty to // Using rate control, we should always keep the emulator's sound buffers empty to
// maintain an accurate measurement. // maintain an accurate measurement.
@ -155,7 +155,7 @@ void CWaveOut::ProcessSound()
waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR)); waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR));
InterlockedIncrement(&bufferCount); InterlockedIncrement(&bufferCount);
writeOffset++; writeOffset++;
writeOffset %= bufferCount; writeOffset %= blockCount;
} }
} }
@ -165,7 +165,7 @@ void CWaveOut::ProcessSound()
waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR)); waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR));
InterlockedIncrement(&bufferCount); InterlockedIncrement(&bufferCount);
writeOffset++; writeOffset++;
writeOffset %= bufferCount; writeOffset %= blockCount;
availableSamples -= singleBufferSamples; availableSamples -= singleBufferSamples;
} }