aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2014-06-22 14:53:38 +0200
committerJohannes Schickel2014-06-22 14:53:38 +0200
commita21c9ef913179fcceef82e2e926e8fc78665f8b0 (patch)
tree936dcde587a4835ca9d7876f85c3db0e03399715 /engines/scumm
parent5be5f36aa90ecb09cde5a3d207860906bb6975f6 (diff)
downloadscummvm-rg350-a21c9ef913179fcceef82e2e926e8fc78665f8b0.tar.gz
scummvm-rg350-a21c9ef913179fcceef82e2e926e8fc78665f8b0.tar.bz2
scummvm-rg350-a21c9ef913179fcceef82e2e926e8fc78665f8b0.zip
SCUMM: Don't allow SFX to reallocate their own channels in AD player.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/players/player_ad.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index 2d8de3a862..a8d9dbfc6a 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -314,7 +314,10 @@ int Player_AD::allocateHWChannel(int priority, SfxSlot *owner) {
// Second pass: Reassign channels based on priority
for (int i = 0; i < _numHWChannels; ++i) {
- if (_hwChannels[i].priority <= priority) {
+ // We don't allow SFX to reallocate their own channels. Otherwise we
+ // would call stopSfx in the midst of startSfx and that can lead to
+ // horrible states...
+ if (_hwChannels[i].priority <= priority && (!owner || _hwChannels[i].sfxOwner != owner)) {
// In case the HW channel belongs to a SFX we will completely
// stop playback of that SFX.
// TODO: Maybe be more fine grained in the future and allow