aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/players/player_ad.cpp12
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;
+ }
+ }
}
}
}