From 79b20494be82b7847df14ad708ab3dc69371a000 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 8 Jun 2010 13:28:12 +0000 Subject: [PATCH] Fixes a crash in the DirectSound back-end. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5635 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/DSoundStream.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Core/AudioCommon/Src/DSoundStream.cpp b/Source/Core/AudioCommon/Src/DSoundStream.cpp index 0df1fbe753..006674d2a3 100644 --- a/Source/Core/AudioCommon/Src/DSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/DSoundStream.cpp @@ -160,14 +160,16 @@ void DSound::Clear(bool mute) { m_muted = mute; - if (m_muted) + if (dsBuffer != NULL) { - if (dsBuffer != NULL) + if (m_muted) + { dsBuffer->Stop(); - } - else - { - dsBuffer->Play(0, 0, DSBPLAY_LOOPING); + } + else + { + dsBuffer->Play(0, 0, DSBPLAY_LOOPING); + } } }