From 603f086180906f2d7a0257bb46b859e937b105d6 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Thu, 26 Apr 2018 03:44:05 -0500 Subject: [PATCH] Replace silence with predefined volume min Plus don't re-set volume twice. --- src/CxbxKrnl/EmuDSoundInline.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/CxbxKrnl/EmuDSoundInline.hpp index 007db8337..738bf5157 100644 --- a/src/CxbxKrnl/EmuDSoundInline.hpp +++ b/src/CxbxKrnl/EmuDSoundInline.hpp @@ -1722,25 +1722,25 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume( if ((dwEmuFlags & DSE_FLAG_PCM) > 0) { if (!g_XBAudio.GetPCM()) { - lVolume = -10000; + lVolume = DSBVOLUME_MIN; } } else if ((dwEmuFlags & DSE_FLAG_XADPCM) > 0) { if (!g_XBAudio.GetXADPCM()) { - lVolume = -10000; + lVolume = DSBVOLUME_MIN; } } else if ((dwEmuFlags & DSE_FLAG_PCM_UNKNOWN) > 0) { if (!g_XBAudio.GetUnknownCodec()) { - lVolume = -10000; + lVolume = DSBVOLUME_MIN; } } - if (lVolume <= -6400) { + if (lVolume <= -6400 && lVolume != DSBVOLUME_MIN) { lVolume = DSBVOLUME_MIN; } else if (lVolume > 0) { EmuWarning("HybridDirectSoundBuffer_SetVolume has received greater than 0: %ld", lVolume); lVolume = 0; } if ((dwEmuFlags & DSE_FLAG_DEBUG_MUTE) > 0) { - lVolume = -10000; + lVolume = DSBVOLUME_MIN; } HRESULT hRet = pDSBuffer->SetVolume(lVolume);