From a21c9ef913179fcceef82e2e926e8fc78665f8b0 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 22 Jun 2014 14:53:38 +0200 Subject: SCUMM: Don't allow SFX to reallocate their own channels in AD player. --- engines/scumm/players/player_ad.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/scumm') 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 -- cgit v1.2.3