From 1cd8d65705e88e4c7d83b6d1ab6ac2197f1a8eb4 Mon Sep 17 00:00:00 2001 From: OV2 Date: Mon, 28 May 2018 12:04:35 +0200 Subject: [PATCH] win32: clear sound buffer when not using default frame time (fixes #310) --- win32/wsnes9x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 26a4c9e1..dc49199a 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -3620,9 +3620,9 @@ int WINAPI WinMain( ProcessInput(); // no sound sync when speed is not set to 100% - while(PCFrameTimeIsDefault && !S9xSyncSound()) { + while(!S9xSyncSound()) { ResetEvent(GUI.SoundSyncEvent); - if(WaitForSingleObject(GUI.SoundSyncEvent,1000) != WAIT_OBJECT_0) + if(!PCFrameTimeIsDefault || WaitForSingleObject(GUI.SoundSyncEvent,1000) != WAIT_OBJECT_0) S9xClearSamples(); }