diff options
author | Max Horn | 2011-03-23 11:47:07 +0100 |
---|---|---|
committer | Max Horn | 2011-03-23 15:25:46 +0100 |
commit | 7b02dac3c5678bb47216495fc97130b98ff2bfe4 (patch) | |
tree | ebeba91f309e1321b4a72136d59672b696eb7849 /engines/scumm | |
parent | 99dbecf3b4a14382fa867610a43201fc150bfda9 (diff) | |
download | scummvm-rg350-7b02dac3c5678bb47216495fc97130b98ff2bfe4.tar.gz scummvm-rg350-7b02dac3c5678bb47216495fc97130b98ff2bfe4.tar.bz2 scummvm-rg350-7b02dac3c5678bb47216495fc97130b98ff2bfe4.zip |
ENGINES: Use Common::StackLock in more places
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/player_pce.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/player_sid.cpp | 18 |
2 files changed, 6 insertions, 16 deletions
diff --git a/engines/scumm/player_pce.cpp b/engines/scumm/player_pce.cpp index 4236fb2d6b..46d976773d 100644 --- a/engines/scumm/player_pce.cpp +++ b/engines/scumm/player_pce.cpp @@ -515,7 +515,7 @@ int Player_PCE::readBuffer(int16 *buffer, const int numSamples) { int sampleCopyCnt; int samplesLeft = numSamples; - _mutex.lock(); + Common::StackLock lock(_mutex); while (true) { // copy samples to output buffer @@ -543,8 +543,6 @@ int Player_PCE::readBuffer(int16 *buffer, const int numSamples) { _sampleBufferCnt * sizeof(int16)); } - _mutex.unlock(); - return numSamples; } diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index 34654a68c5..0d5832a5fb 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -1287,7 +1287,7 @@ uint8 *Player_SID::getResource(int resID) { int Player_SID::readBuffer(int16 *buffer, const int numSamples) { int samplesLeft = numSamples; - _mutex.lock(); + Common::StackLock lock(_mutex); while (samplesLeft > 0) { // update SID status after each frame @@ -1301,8 +1301,6 @@ int Player_SID::readBuffer(int16 *buffer, const int numSamples) { buffer += sampleCount; } - _mutex.unlock(); - return numSamples; } @@ -1337,7 +1335,7 @@ void Player_SID::startSound(int nr) { // prio 7 is never used in any sound file use this byte for auto-detection. bool isMusic = (data[4] == 0x07); - _mutex.lock(); + Common::StackLock lock(_mutex); if (isMusic) { initMusic(nr); @@ -1345,29 +1343,25 @@ void Player_SID::startSound(int nr) { stopSound_intern(nr); initSound(nr); } - - _mutex.unlock(); } void Player_SID::stopSound(int nr) { if (nr == -1) return; - _mutex.lock(); + Common::StackLock lock(_mutex); stopSound_intern(nr); - _mutex.unlock(); } void Player_SID::stopAllSounds() { - _mutex.lock(); + Common::StackLock lock(_mutex); stopAllSounds_intern(); - _mutex.unlock(); } int Player_SID::getSoundStatus(int nr) const { int result = 0; - //_mutex.lock(); + //Common::StackLock lock(_mutex); if (resID_song == nr && isMusicPlaying) { result = 1; @@ -1379,8 +1373,6 @@ int Player_SID::getSoundStatus(int nr) const { } } - //_mutex.unlock(); - return result; } |