aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2008-01-05 22:35:30 +0000
committerMax Horn2008-01-05 22:35:30 +0000
commit923ad313dc1e85ff3e2169f08abe0b2e016896c2 (patch)
tree9f2997cd35bae683006e1d75382040e81dfd500f /engines
parent64601d446f3de6099e3f2d043bfde3136e4a330d (diff)
downloadscummvm-rg350-923ad313dc1e85ff3e2169f08abe0b2e016896c2.tar.gz
scummvm-rg350-923ad313dc1e85ff3e2169f08abe0b2e016896c2.tar.bz2
scummvm-rg350-923ad313dc1e85ff3e2169f08abe0b2e016896c2.zip
Let the audio mixer delete the streamSou object
svn-id: r30265
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/imuse_digi/dimuse.cpp4
-rw-r--r--engines/scumm/imuse_digi/dimuse_script.cpp20
-rw-r--r--engines/scumm/imuse_digi/dimuse_track.cpp2
3 files changed, 7 insertions, 19 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp
index 76233dce26..9c28a67d41 100644
--- a/engines/scumm/imuse_digi/dimuse.cpp
+++ b/engines/scumm/imuse_digi/dimuse.cpp
@@ -357,13 +357,13 @@ void IMuseDigital::callback() {
assert(feedSize >= 0);
} while (feedSize != 0);
} else {
- assert(track->streamSou);
if (_mixer->isReady()) {
// FIXME: Can't we replace track->mixerStreamRunning by
// _mixer->isSoundHandleActive(track->mixChanHandle) ?
if (!track->mixerStreamRunning) {
track->mixerStreamRunning = true;
- _mixer->playInputStream(type, &track->mixChanHandle, track->streamSou, -1, vol, pan, false);
+ assert(track->streamSou);
+ _mixer->playInputStream(type, &track->mixChanHandle, track->streamSou, -1, vol, pan);
} else {
_mixer->setChannelVolume(track->mixChanHandle, vol);
_mixer->setChannelBalance(track->mixChanHandle, pan);
diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp
index 0d3ee7440b..9e3337076a 100644
--- a/engines/scumm/imuse_digi/dimuse_script.cpp
+++ b/engines/scumm/imuse_digi/dimuse_script.cpp
@@ -175,17 +175,12 @@ void IMuseDigital::flushTrack(Track *track) {
if (track->stream->endOfStream()) {
_mixer->stopHandle(track->mixChanHandle);
delete track->stream;
- track->stream = NULL;
_sound->closeSound(track->soundDesc);
- track->soundDesc = NULL;
- track->used = false;
+ memset(track, 0, sizeof(Track));
}
} else {
- assert(track->streamSou);
_mixer->stopHandle(track->mixChanHandle);
- delete track->streamSou;
- track->streamSou = NULL;
- track->used = false;
+ memset(track, 0, sizeof(Track));
}
}
@@ -400,22 +395,15 @@ void IMuseDigital::stopAllSounds() {
// Stop the sound output, *now*. No need to use toBeRemoved etc.
// as we are protected by a mutex, and this method is never called
// from IMuseDigital::callback either.
+ _mixer->stopHandle(track->mixChanHandle);
if (!track->souStreamUsed) {
assert(track->stream);
- _mixer->stopHandle(track->mixChanHandle);
delete track->stream;
_sound->closeSound(track->soundDesc);
- } else if (track->streamSou) {
- assert(track->streamSou);
- _mixer->stopHandle(track->mixChanHandle);
- delete track->streamSou;
}
// Mark the track as unused
- track->soundDesc = NULL;
- track->streamSou = NULL;
- track->stream = NULL;
- track->used = false;
+ memset(track, 0, sizeof(Track));
}
}
}
diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp
index 7dff90b65a..f7cc3f27af 100644
--- a/engines/scumm/imuse_digi/dimuse_track.cpp
+++ b/engines/scumm/imuse_digi/dimuse_track.cpp
@@ -52,7 +52,7 @@ int IMuseDigital::allocSlot(int priority) {
for (l = 0; l < MAX_DIGITAL_TRACKS; l++) {
Track *track = _track[l];
if (track->used && !track->toBeRemoved &&
- (lowest_priority > track->soundPriority) && !track->streamSou) {
+ (lowest_priority > track->soundPriority) && !track->souStreamUsed) {
lowest_priority = track->soundPriority;
trackId = l;
}