diff options
author | Max Horn | 2008-01-06 13:54:19 +0000 |
---|---|---|
committer | Max Horn | 2008-01-06 13:54:19 +0000 |
commit | 79ba9686eb6dbce083e5d182024995e67c03d1d0 (patch) | |
tree | c9a2e2699abd6aeef3983cd1db4cd036ab444524 /engines/scumm/imuse_digi | |
parent | 743858b097107c129d7884ef523c69f5b296363e (diff) | |
download | scummvm-rg350-79ba9686eb6dbce083e5d182024995e67c03d1d0.tar.gz scummvm-rg350-79ba9686eb6dbce083e5d182024995e67c03d1d0.tar.bz2 scummvm-rg350-79ba9686eb6dbce083e5d182024995e67c03d1d0.zip |
Fix bug #1864932: COMI: Game crashes on difficulty selection screen
svn-id: r30298
Diffstat (limited to 'engines/scumm/imuse_digi')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 93e7e831ed..7af4d84676 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -218,9 +218,11 @@ void IMuseDigital::callback() { for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) { Track *track = _track[l]; if (track->used) { - // Remove tracks if necessary - if (!_mixer->isSoundHandleActive(track->mixChanHandle)) { - memset(track, 0, sizeof(Track)); + // Ignore tracks which are about to finish. Also, if it did finish in the meantime, + // mark it as unused. + if (!track->stream) { + if (!_mixer->isSoundHandleActive(track->mixChanHandle)) + memset(track, 0, sizeof(Track)); continue; } @@ -260,7 +262,7 @@ void IMuseDigital::callback() { if (track->curRegion == -1) { switchToNextRegion(track); - if (track->toBeRemoved || !track->used) + if (!track->stream) // Seems we reached the end of the stream continue; } @@ -328,7 +330,7 @@ void IMuseDigital::callback() { if (_sound->isEndOfRegion(track->soundDesc, track->curRegion)) { switchToNextRegion(track); - if (track->toBeRemoved || !track->used) + if (!track->stream) // Seems we reached the end of the stream break; } feedSize -= curFeedSize; |