diff options
author | Max Horn | 2008-01-05 20:43:07 +0000 |
---|---|---|
committer | Max Horn | 2008-01-05 20:43:07 +0000 |
commit | c9a8d02f6ef8f2f67b6c24228ff043ba975241c5 (patch) | |
tree | 4891622b9440d3f6ef74d3fb9d5ded96228c7030 /engines/scumm/imuse_digi/dimuse_track.cpp | |
parent | 2c8910ade855c1bee56026ba7ad2f40bedc88803 (diff) | |
download | scummvm-rg350-c9a8d02f6ef8f2f67b6c24228ff043ba975241c5.tar.gz scummvm-rg350-c9a8d02f6ef8f2f67b6c24228ff043ba975241c5.tar.bz2 scummvm-rg350-c9a8d02f6ef8f2f67b6c24228ff043ba975241c5.zip |
Do not busy wait in IMuseDigital::allocSlot on *any* platform
svn-id: r30255
Diffstat (limited to 'engines/scumm/imuse_digi/dimuse_track.cpp')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index faaae470e7..402385aa2c 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -60,20 +60,16 @@ int IMuseDigital::allocSlot(int priority) { if (lowest_priority <= priority) { assert(trackId != -1); Track *track = _track[trackId]; - while (1) { - if (!track->used) { - break; - } + // 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); - _mutex.unlock(); - #ifndef __PLAYSTATION2__ _vm->parseEvents(); - #endif - _mutex.lock(); } debug(5, "IMuseDigital::allocSlot(): Removed sound %d from track %d", _track[trackId]->soundId, trackId); } else { |