aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorD G Turner2012-08-11 20:08:03 +0100
committerD G Turner2012-08-11 20:08:03 +0100
commit21c057ce7545d9fbb1cd958d22cbce5716384882 (patch)
tree96a89ab8c927b115d619b1ff227119d5610a0646 /engines/cine
parent1f91cc1aa0a21c80aa6d31934078b5d2a5e18f08 (diff)
downloadscummvm-rg350-21c057ce7545d9fbb1cd958d22cbce5716384882.tar.gz
scummvm-rg350-21c057ce7545d9fbb1cd958d22cbce5716384882.tar.bz2
scummvm-rg350-21c057ce7545d9fbb1cd958d22cbce5716384882.zip
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.
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/sound.cpp3
1 files changed, 2 insertions, 1 deletions
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);