[Scummvm-git-logs] scummvm master -> 74222486250c777624c3d510b2d57024dba569b8
dreammaster
dreammaster at scummvm.org
Sat Feb 11 05:15:22 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7422248625 TITANIC: Use critical section methods when reading from audio buffer
Commit: 74222486250c777624c3d510b2d57024dba569b8
https://github.com/scummvm/scummvm/commit/74222486250c777624c3d510b2d57024dba569b8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-10T23:15:08-05:00
Commit Message:
TITANIC: Use critical section methods when reading from audio buffer
Changed paths:
engines/titanic/sound/wave_file.cpp
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index 4a9f64b..a4cd9d3 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -48,12 +48,14 @@ public:
};
int AudioBufferStream::readBuffer(int16 *buffer, const int numSamples) {
+ _audioBuffer->enterCriticalSection();
int samplesToRead = MIN((const int)numSamples, (const int)(_audioBuffer->getBytesToRead() / sizeof(uint16)));
const int16 *src = _audioBuffer->getReadPtr();
Common::copy(src, src + samplesToRead, buffer);
_audioBuffer->advanceRead(samplesToRead * 2);
+ _audioBuffer->leaveCriticalSection();
return samplesToRead;
}
More information about the Scummvm-git-logs
mailing list