diff options
author | Max Horn | 2008-01-05 23:44:05 +0000 |
---|---|---|
committer | Max Horn | 2008-01-05 23:44:05 +0000 |
commit | ef9dac103f5610dd89d01cf52342d1325481e8ff (patch) | |
tree | 13e6311f40edcf79f60f61b11bac44c90ba6d120 /engines/scumm/imuse_digi/dimuse_track.cpp | |
parent | dce7a57cad0c7704e3331f1ac5b30af319a8cead (diff) | |
download | scummvm-rg350-ef9dac103f5610dd89d01cf52342d1325481e8ff.tar.gz scummvm-rg350-ef9dac103f5610dd89d01cf52342d1325481e8ff.tar.bz2 scummvm-rg350-ef9dac103f5610dd89d01cf52342d1325481e8ff.zip |
stop low priority sounds which we want to override immediatly
svn-id: r30275
Diffstat (limited to 'engines/scumm/imuse_digi/dimuse_track.cpp')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index c428bb735f..bc71e71b10 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -60,17 +60,18 @@ int IMuseDigital::allocSlot(int priority) { if (lowest_priority <= priority) { assert(trackId != -1); Track *track = _track[trackId]; - // FIXME: Should we really wait for the sound to finish "nicely"? - // Why not just stop it immediately? - - while (track->used) { - // The designated track is not yet available. So, we call flushTrack() - // to get it processed (and thus made ready for us). Since the actual - // processing is done by another thread, we also call parseEvents to - // give it some time (and to avoid busy waiting/looping). - flushTrack(track); - _vm->parseEvents(); + + // Stop the track immediately + _mixer->stopHandle(track->mixChanHandle); + if (!track->souStreamUsed) { + assert(track->stream); + delete track->stream; + _sound->closeSound(track->soundDesc); } + + // Mark it as unused + memset(track, 0, sizeof(Track)); + debug(5, "IMuseDigital::allocSlot(): Removed sound %d from track %d", _track[trackId]->soundId, trackId); } else { debug(5, "IMuseDigital::allocSlot(): Priority sound too low"); |