From 3d453ba0215b72226146a8131a6379e6b0d17cdb Mon Sep 17 00:00:00 2001 From: Souryo Date: Sun, 4 Sep 2016 19:04:52 -0400 Subject: [PATCH] Auto Save: Prevent saves from starting an audio loop --- Core/Console.cpp | 3 ++- Core/SoundMixer.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/Console.cpp b/Core/Console.cpp index f1676dcd..6a83653b 100644 --- a/Core/Console.cpp +++ b/Core/Console.cpp @@ -310,10 +310,11 @@ void Console::Run() bool paused = EmulationSettings::IsPaused(); if(paused && !_stop) { MessageManager::SendNotification(ConsoleNotificationType::GamePaused); - _runLock.Release(); //Prevent audio from looping endlessly while game is paused SoundMixer::StopAudio(); + + _runLock.Release(); PlatformUtilities::EnableScreensaver(); while(paused && !_stop) { diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index 380c3f0b..82a80346 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -77,7 +77,7 @@ void SoundMixer::PlayAudioBuffer(uint32_t time) { EndFrame(time); size_t sampleCount = blip_read_samples(_blipBuf, _outputBuffer, SoundMixer::MaxSamplesPerFrame, 0); - if(SoundMixer::AudioDevice) { + if(SoundMixer::AudioDevice && !EmulationSettings::IsPaused()) { //Apply low pass filter/volume reduction when in background (based on options) if(!_waveRecorder && !EmulationSettings::CheckFlag(EmulationFlags::NsfPlayerEnabled) && EmulationSettings::CheckFlag(EmulationFlags::InBackground)) { if(EmulationSettings::CheckFlag(EmulationFlags::MuteSoundInBackground)) {