aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/imuse_digi/dimuse.cpp12
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;