diff options
author | Johannes Schickel | 2014-06-22 14:53:38 +0200 |
---|---|---|
committer | Johannes Schickel | 2014-06-22 14:53:38 +0200 |
commit | 5be5f36aa90ecb09cde5a3d207860906bb6975f6 (patch) | |
tree | 730461406936324953a8498be4d67f45fe01aad0 | |
parent | ac806a1fde24e5101938a8b24777f43474ebb224 (diff) | |
download | scummvm-rg350-5be5f36aa90ecb09cde5a3d207860906bb6975f6.tar.gz scummvm-rg350-5be5f36aa90ecb09cde5a3d207860906bb6975f6.tar.bz2 scummvm-rg350-5be5f36aa90ecb09cde5a3d207860906bb6975f6.zip |
SCUMM: Clear SFX channel when starting the SFX failed in AD player.
-rw-r--r-- | engines/scumm/players/player_ad.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp index 1176a62112..2d8de3a862 100644 --- a/engines/scumm/players/player_ad.cpp +++ b/engines/scumm/players/player_ad.cpp @@ -137,6 +137,18 @@ void Player_AD::startSound(int sound) { if (startSfx(sfx, res)) { // Lock the new resource _vm->_res->lock(rtSound, sound); + } else { + // When starting the sfx failed we need to reset the slot. + sfx->resource = -1; + + for (int i = 0; i < ARRAYSIZE(sfx->channels); ++i) { + sfx->channels[i].state = kChannelStateOff; + + if (sfx->channels[i].hardwareChannel != -1) { + freeHWChannel(sfx->channels[i].hardwareChannel); + sfx->channels[i].hardwareChannel = -1; + } + } } } } |