From 21c057ce7545d9fbb1cd958d22cbce5716384882 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 11 Aug 2012 20:08:03 +0100 Subject: CINE: Fix lockup in Scene 5 when "operate Girl" underwater. Traced with gdb to sound.cpp:792 i.e. _fadeOutTimer infinite loop. This bug was introduced by the addition of the MT-32 output driver for Future Wars and associated mutex changes. The _fadeOutTimer increment is done by the timer callback occuring during the load method call, but this was excluded by the mutex. Fixed by moving the mutex in the load method. --- engines/cine/sound.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index b2e992e8f6..52e1cdac7e 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -785,7 +785,6 @@ PCSoundFxPlayer::~PCSoundFxPlayer() { bool PCSoundFxPlayer::load(const char *song) { debug(9, "PCSoundFxPlayer::load('%s')", song); - Common::StackLock lock(_mutex); /* stop (w/ fade out) the previous song */ while (_fadeOutCounter != 0 && _fadeOutCounter < 100) { @@ -793,6 +792,8 @@ bool PCSoundFxPlayer::load(const char *song) { } _fadeOutCounter = 0; + Common::StackLock lock(_mutex); + stop(); _sfxData = readBundleSoundFile(song); -- cgit v1.2.3