diff options
author | Torbjörn Andersson | 2008-08-20 09:12:11 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2008-08-20 09:12:11 +0000 |
commit | eb35835f5ee5010bd38f99a6e0995e01b0c7013f (patch) | |
tree | a71750cdd1bc4dc11057844183f4fea4fe979b64 /engines | |
parent | 9549cbee7f325ae18b9c6cb965073e931540ff2e (diff) | |
download | scummvm-rg350-eb35835f5ee5010bd38f99a6e0995e01b0c7013f.tar.gz scummvm-rg350-eb35835f5ee5010bd38f99a6e0995e01b0c7013f.tar.bz2 scummvm-rg350-eb35835f5ee5010bd38f99a6e0995e01b0c7013f.zip |
I believe the setVolume() function has to be guarded by a mutex. (I added this to
the Tinsel engine a while back to fix mysterious problems, but forgot to add it
elsewhere.) Maybe this will fix the mysterious IHNM crashes, as well?
svn-id: r34048
Diffstat (limited to 'engines')
-rw-r--r-- | engines/made/music.cpp | 2 | ||||
-rw-r--r-- | engines/saga/music.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/engines/made/music.cpp b/engines/made/music.cpp index c3b36d3b8c..0b58a11774 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -63,6 +63,8 @@ void MusicPlayer::setVolume(int volume) { _masterVolume = volume; + Common::StackLock lock(_mutex); + for (int i = 0; i < 16; ++i) { if (_channel[i]) { _channel[i]->volume(_channelVolume[i] * _masterVolume / 255); diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 732bd0b50c..75008efb7d 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -249,6 +249,8 @@ void MusicPlayer::setVolume(int volume) { _masterVolume = volume; + Common::StackLock lock(_mutex); + for (int i = 0; i < 16; ++i) { if (_channel[i]) { _channel[i]->volume(_channelVolume[i] * _masterVolume / 255); |