[Scummvm-cvs-logs] SF.net SVN: scummvm:[34048] scummvm/trunk/engines

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Aug 20 11:12:12 CEST 2008


Revision: 34048
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34048&view=rev
Author:   eriktorbjorn
Date:     2008-08-20 09:12:11 +0000 (Wed, 20 Aug 2008)

Log Message:
-----------
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?

Modified Paths:
--------------
    scummvm/trunk/engines/made/music.cpp
    scummvm/trunk/engines/saga/music.cpp

Modified: scummvm/trunk/engines/made/music.cpp
===================================================================
--- scummvm/trunk/engines/made/music.cpp	2008-08-20 04:02:12 UTC (rev 34047)
+++ scummvm/trunk/engines/made/music.cpp	2008-08-20 09:12:11 UTC (rev 34048)
@@ -63,6 +63,8 @@
 
 	_masterVolume = volume;
 
+	Common::StackLock lock(_mutex);
+
 	for (int i = 0; i < 16; ++i) {
 		if (_channel[i]) {
 			_channel[i]->volume(_channelVolume[i] * _masterVolume / 255);

Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp	2008-08-20 04:02:12 UTC (rev 34047)
+++ scummvm/trunk/engines/saga/music.cpp	2008-08-20 09:12:11 UTC (rev 34048)
@@ -249,6 +249,8 @@
 
 	_masterVolume = volume;
 
+	Common::StackLock lock(_mutex);
+
 	for (int i = 0; i < 16; ++i) {
 		if (_channel[i]) {
 			_channel[i]->volume(_channelVolume[i] * _masterVolume / 255);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list