aboutsummaryrefslogtreecommitdiff
path: root/scumm/imuse_digi
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-06-20 20:13:01 +0000
committerPaweł Kołodziejski2004-06-20 20:13:01 +0000
commitaf3d1237300c983da6733e0ff118414d7883367e (patch)
treec0798dad5db7d4ab872d10026046baec06b8c782 /scumm/imuse_digi
parentce0e71dd1c3a3c0577695ccb19d619064a90522a (diff)
downloadscummvm-rg350-af3d1237300c983da6733e0ff118414d7883367e.tar.gz
scummvm-rg350-af3d1237300c983da6733e0ff118414d7883367e.tar.bz2
scummvm-rg350-af3d1237300c983da6733e0ff118414d7883367e.zip
added exception for insane sounds to prevent deadlock
svn-id: r13983
Diffstat (limited to 'scumm/imuse_digi')
-rw-r--r--scumm/imuse_digi/dimuse_script.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/scumm/imuse_digi/dimuse_script.cpp b/scumm/imuse_digi/dimuse_script.cpp
index d6b4918855..2209ff023c 100644
--- a/scumm/imuse_digi/dimuse_script.cpp
+++ b/scumm/imuse_digi/dimuse_script.cpp
@@ -163,19 +163,23 @@ void IMuseDigital::flushTracks() {
debug(5, "flushTracks()");
for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) {
Track *track = _track[l];
- if (track->used && track->readyToRemove) {
- if (track->stream) {
+ if (track->used &&
+ (track->readyToRemove || (!_vm->_videoFinished && track->toBeRemoved))) {
+ if ((track->stream) && (!track->stream->endOfStream())) {
track->stream->finish();
- track->stream = NULL;
+ } else if ((track->stream) && (track->stream->endOfStream())) {
_vm->_mixer->stopHandle(track->handle);
+ delete track->stream;
+ track->stream = NULL;
_sound->closeSound(track->soundHandle);
track->soundHandle = NULL;
+ track->used = false;
} else if (track->stream2) {
_vm->_mixer->stopHandle(track->handle);
delete track->stream2;
track->stream2 = NULL;
+ track->used = false;
}
- track->used = false;
}
}
}
@@ -385,4 +389,3 @@ void IMuseDigital::pause(bool p) {
}
} // End of namespace Scumm
-