From 36ea7f30bf3b48a90bc12893e982c538071b9a7b Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 20 Oct 2014 09:43:05 +1100 Subject: [PATCH] Only restart sfx if they were really paused. --- src/audio/sfx_openal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/audio/sfx_openal.cpp b/src/audio/sfx_openal.cpp index 0cb3fb062..a84c0fd7f 100644 --- a/src/audio/sfx_openal.cpp +++ b/src/audio/sfx_openal.cpp @@ -259,7 +259,6 @@ void SFXOpenAL::reallyStopNow() */ void SFXOpenAL::pause() { - if (m_status != SFX_PLAYING || !SFXManager::get()->sfxAllowed()) return; SFXManager::get()->queue(SFXManager::SFX_PAUSE, this); } // pause @@ -269,6 +268,9 @@ void SFXOpenAL::pause() */ void SFXOpenAL::reallyPauseNow() { + // Need to be tested again here, since this function can be called + // from pauseAll, and we have to make sure to only pause playing sfx. + if (m_status != SFX_PLAYING || !SFXManager::get()->sfxAllowed()) return; m_status = SFX_PAUSED; alSourcePause(m_sound_source); SFXManager::checkError("pausing");