Replace silence with predefined volume min

Plus don't re-set volume twice.
This commit is contained in:
RadWolfie 2018-04-26 03:44:05 -05:00
parent e9bdc1f0b5
commit 603f086180
1 changed files with 5 additions and 5 deletions

View File

@ -1722,25 +1722,25 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume(
if ((dwEmuFlags & DSE_FLAG_PCM) > 0) { if ((dwEmuFlags & DSE_FLAG_PCM) > 0) {
if (!g_XBAudio.GetPCM()) { if (!g_XBAudio.GetPCM()) {
lVolume = -10000; lVolume = DSBVOLUME_MIN;
} }
} else if ((dwEmuFlags & DSE_FLAG_XADPCM) > 0) { } else if ((dwEmuFlags & DSE_FLAG_XADPCM) > 0) {
if (!g_XBAudio.GetXADPCM()) { if (!g_XBAudio.GetXADPCM()) {
lVolume = -10000; lVolume = DSBVOLUME_MIN;
} }
} else if ((dwEmuFlags & DSE_FLAG_PCM_UNKNOWN) > 0) { } else if ((dwEmuFlags & DSE_FLAG_PCM_UNKNOWN) > 0) {
if (!g_XBAudio.GetUnknownCodec()) { if (!g_XBAudio.GetUnknownCodec()) {
lVolume = -10000; lVolume = DSBVOLUME_MIN;
} }
} }
if (lVolume <= -6400) { if (lVolume <= -6400 && lVolume != DSBVOLUME_MIN) {
lVolume = DSBVOLUME_MIN; lVolume = DSBVOLUME_MIN;
} else if (lVolume > 0) { } else if (lVolume > 0) {
EmuWarning("HybridDirectSoundBuffer_SetVolume has received greater than 0: %ld", lVolume); EmuWarning("HybridDirectSoundBuffer_SetVolume has received greater than 0: %ld", lVolume);
lVolume = 0; lVolume = 0;
} }
if ((dwEmuFlags & DSE_FLAG_DEBUG_MUTE) > 0) { if ((dwEmuFlags & DSE_FLAG_DEBUG_MUTE) > 0) {
lVolume = -10000; lVolume = DSBVOLUME_MIN;
} }
HRESULT hRet = pDSBuffer->SetVolume(lVolume); HRESULT hRet = pDSBuffer->SetVolume(lVolume);