aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-22 21:34:20 +0000
committerMax Horn2003-05-22 21:34:20 +0000
commit1383ccbdbe0de2a7777c9d8b5d786d7b8a48b67e (patch)
treeb954980e4b753893d4093c80eb6bcc48cf56273e
parentc152233f80e90e2f54b8a5a558be9d777046f152 (diff)
downloadscummvm-rg350-1383ccbdbe0de2a7777c9d8b5d786d7b8a48b67e.tar.gz
scummvm-rg350-1383ccbdbe0de2a7777c9d8b5d786d7b8a48b67e.tar.bz2
scummvm-rg350-1383ccbdbe0de2a7777c9d8b5d786d7b8a48b67e.zip
make sure that the mutex protects everything that affects the buffer
svn-id: r7835
-rw-r--r--sound/mixer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 890f155db8..769a1254ed 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -152,6 +152,7 @@ int SoundMixer::playVorbis(PlayingSoundHandle *handle, OggVorbis_File *ov_file,
#endif
void SoundMixer::mix(int16 *buf, uint len) {
+ _syst->lock_mutex(_mutex);
if (_paused) {
memset(buf, 0, 2 * len * sizeof(int16));
return;
@@ -168,7 +169,6 @@ void SoundMixer::mix(int16 *buf, uint len) {
memset(buf, 0, 2 * len * sizeof(int16));
}
- _syst->lock_mutex(_mutex);
/* now mix all channels */
for (int i = 0; i != NUM_CHANNELS; i++)
if (_channels[i])