From 51a798989ba61b23c825931b5b81853e58afb641 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 30 Mar 2013 18:54:10 +0100 Subject: [PATCH] Let's not play noise when paused on Windows. --- Core/PSPMixer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/PSPMixer.cpp b/Core/PSPMixer.cpp index e8b99fccfc..69cec9f4c9 100644 --- a/Core/PSPMixer.cpp +++ b/Core/PSPMixer.cpp @@ -26,5 +26,13 @@ int PSPMixer::Mix(short *stereoout, int numSamples) { - return __AudioMix(stereoout, numSamples); + int numFrames = __AudioMix(stereoout, numSamples); +#ifdef _WIN32 + if (numFrames < numSamples) { + // Our dsound backend will not stop playing, let's just feed it zeroes if we miss data. + memset(stereoout + 2 * 2 * numFrames, 0, 2 * 2 * (numSamples - numFrames)); + numFrames = numSamples; + } +#endif + return numFrames; }