aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2005-04-04 17:43:00 +0000
committerMax Horn2005-04-04 17:43:00 +0000
commit9e2e00881f4fcaa921e251dd237ee9aed06bf3cb (patch)
tree31554712d3ab433aebef5cf9274438587c5b2e73 /sound
parente46a677c0ee9621cefe82031796c2337b6319d84 (diff)
downloadscummvm-rg350-9e2e00881f4fcaa921e251dd237ee9aed06bf3cb.tar.gz
scummvm-rg350-9e2e00881f4fcaa921e251dd237ee9aed06bf3cb.tar.bz2
scummvm-rg350-9e2e00881f4fcaa921e251dd237ee9aed06bf3cb.zip
Renamed getActiveChannelSoundID to getSoundID and fixed its semantics to avoid race conditions
svn-id: r17377
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp4
-rw-r--r--sound/mixer.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index f9f0e32316..5face1f8a9 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -367,10 +367,10 @@ bool SoundMixer::isSoundIDActive(int id) {
return false;
}
-int SoundMixer::getActiveChannelSoundID(SoundHandle handle) {
+int SoundMixer::getSoundID(SoundHandle handle) {
Common::StackLock lock(_mutex);
const int index = handle._val % NUM_CHANNELS;
- if (_channels[index])
+ if (_channels[index] && _channels[index]->_handle._val == handle._val)
return _channels[index]->getId();
return 0;
}
diff --git a/sound/mixer.h b/sound/mixer.h
index 6b888af247..39daad86ca 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -210,7 +210,7 @@ public:
* @param handle sound to query
* @return sound ID if active
*/
- int getActiveChannelSoundID(SoundHandle handle);
+ int getSoundID(SoundHandle handle);
/**
* Check if a sound with the given hANDLE is active.