mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
Renamed getActiveChannelSoundID to getSoundID and fixed its semantics to avoid race conditions
svn-id: r17377
This commit is contained in:
parent
e46a677c0e
commit
9e2e00881f
@ -849,11 +849,7 @@ int Sound::isSoundRunning(int sound) const {
|
||||
else if (_vm->_imuse)
|
||||
return (_vm->_imuse->getSoundStatus(sound));
|
||||
} else if (sound >= 10000) {
|
||||
int channel = sound - 10000;
|
||||
if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[channel]))
|
||||
return _vm->_mixer->getActiveChannelSoundID(_heSoundChannels[channel]);
|
||||
else
|
||||
return 0;
|
||||
return _vm->_mixer->getSoundID(_heSoundChannels[sound - 10000]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user