Skip to content

Commit

Permalink
CINE: Fix lockup in Scene 5 when "operate Girl" underwater.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
digitall committed Aug 11, 2012
1 parent 1f91cc1 commit 21c057c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/cine/sound.cpp
Expand Up @@ -785,14 +785,15 @@ 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) {
g_system->delayMillis(50);
}
_fadeOutCounter = 0;

Common::StackLock lock(_mutex);

stop();

_sfxData = readBundleSoundFile(song);
Expand Down

0 comments on commit 21c057c

Please sign in to comment.