From bb0a66b7f9aec24ca3695daca8f87c72100221d3 Mon Sep 17 00:00:00 2001 From: Alias Letterman Date: Mon, 11 Feb 2019 19:45:45 -0600 Subject: [PATCH] win32: WaveOut: Fix dumb mistake. --- win32/CWaveOut.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32/CWaveOut.cpp b/win32/CWaveOut.cpp index a2bc386a..30387c2b 100644 --- a/win32/CWaveOut.cpp +++ b/win32/CWaveOut.cpp @@ -123,7 +123,7 @@ void CWaveOut::ProcessSound() availableSamples = S9xGetSampleCount(); - if (Settings.DynamicRateControl) + if (Settings.DynamicRateControl && !Settings.SoundSync) { // Using rate control, we should always keep the emulator's sound buffers empty to // maintain an accurate measurement. @@ -155,7 +155,7 @@ void CWaveOut::ProcessSound() waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR)); InterlockedIncrement(&bufferCount); writeOffset++; - writeOffset %= bufferCount; + writeOffset %= blockCount; } } @@ -165,7 +165,7 @@ void CWaveOut::ProcessSound() waveOutWrite(hWaveOut, &waveHeaders[writeOffset], sizeof(WAVEHDR)); InterlockedIncrement(&bufferCount); writeOffset++; - writeOffset %= bufferCount; + writeOffset %= blockCount; availableSamples -= singleBufferSamples; }