aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-06-19 14:41:04 +0000
committerPaweł Kołodziejski2004-06-19 14:41:04 +0000
commit726ac17b6ebcad268f6c8c7a88090a9081cb82ee (patch)
tree7d8b11fc03463da5a5cbdde36c0aad3a52fb35dc
parenta7d7e6eb7adf660cf7c98ba955c410024050853e (diff)
downloadscummvm-rg350-726ac17b6ebcad268f6c8c7a88090a9081cb82ee.tar.gz
scummvm-rg350-726ac17b6ebcad268f6c8c7a88090a9081cb82ee.tar.bz2
scummvm-rg350-726ac17b6ebcad268f6c8c7a88090a9081cb82ee.zip
experimental fix for expired sounds
svn-id: r13963
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 1c5431e86c..b2298517a4 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -371,8 +371,15 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
void ImuseDigiSndMgr::closeSound(soundStruct *soundHandle) {
assert(soundHandle && checkForProperHandle(soundHandle));
- if (soundHandle->resPtr)
- _vm->unlock(rtSound, soundHandle->soundId);
+ if (soundHandle->resPtr) {
+ bool found = false;
+ for (int l = 0; l < MAX_IMUSE_SOUNDS; l++) {
+ if ((_sounds[l].soundId == soundHandle->soundId) && (&_sounds[l] != soundHandle))
+ found = true;
+ }
+ if (!found)
+ _vm->unlock(rtSound, soundHandle->soundId);
+ }
delete soundHandle->bundle;
for (int r = 0; r < soundHandle->numSyncs; r++)