summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/Src/AlsaSoundStream.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/AlsaSoundStream.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/AlsaSoundStream.cpp')
-rw-r--r--Source/Core/AudioCommon/Src/AlsaSoundStream.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp b/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
index 8158fc6a86..dfc23300b0 100644
--- a/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
@@ -67,7 +67,7 @@ void AlsaSound::SoundLoop()
// nakee: What is the optimal value?
int frames_to_deliver = 4096;
m_mixer->Mix(reinterpret_cast<short *>(mix_buffer), frames_to_deliver);
- int rc = snd_pcm_writei(handle, mix_buffer, frames_to_deliver);
+ int rc = g_muted ? 1337 : snd_pcm_writei(handle, mix_buffer, frames_to_deliver);
if (rc == -EPIPE)
{
// Underrun
@@ -180,6 +180,13 @@ bool AlsaSound::AlsaInit()
NOTICE_LOG(AUDIO, "ALSA successfully initialized.\n");
return true;
}
+
+void AlsaSound::Mute(bool bMute) {
+ if((bMute && g_muted) || (!bMute && !g_muted))
+ return;
+
+ g_muted = bMute;
+}
void AlsaSound::AlsaShutdown()
{