summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/Src/AOSoundStream.cpp
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2009-12-10 21:00:52 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2009-12-10 21:00:52 +0000
commit6bea0a2f5314f12ad1d163f7c7d63e49c4bdc905 (patch)
treef9ef85142b8cc6a2266d66eac744b5a9a59ebc18 /Source/Core/AudioCommon/Src/AOSoundStream.cpp
parentd901fd2e38bd4f333e26ba48a52878c1c352c060 (diff)
Fixed annoying sound when pausing/shutting down (please test for ALL backends) (couldn't do this for CoreAudio and PulseAudio too)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4676 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/AudioCommon/Src/AOSoundStream.cpp')
-rw-r--r--Source/Core/AudioCommon/Src/AOSoundStream.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/Src/AOSoundStream.cpp b/Source/Core/AudioCommon/Src/AOSoundStream.cpp
index 137864a832..85766495be 100644
--- a/Source/Core/AudioCommon/Src/AOSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/AOSoundStream.cpp
@@ -51,7 +51,8 @@ void AOSound::SoundLoop()
{
soundCriticalSection.Enter();
m_mixer->Mix(realtimeBuffer, numBytesToRender >> 2);
- ao_play(device, (char*)realtimeBuffer, numBytesToRender);
+ if(!g_muted)
+ ao_play(device, (char*)realtimeBuffer, numBytesToRender);
soundCriticalSection.Leave();
if (! threadData)
@@ -105,4 +106,12 @@ AOSound::~AOSound() {
// FIXME: crashes dolphin
// ao_shutdown();
}
+
+void AOSound::Mute(bool bMute) {
+ if((bMute && g_muted) || (!bMute && !g_muted))
+ return;
+
+ g_muted = bMute;
+}
+
#endif