From 3e5515cc21d8e898fd69464643255d135c5b942d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Sep 2017 15:23:43 -0400 Subject: TITANIC: Improve audio buffer critial section handling --- engines/titanic/sound/audio_buffer.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'engines/titanic/sound/audio_buffer.h') diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h index ad8c3e4064..c775c5bb35 100644 --- a/engines/titanic/sound/audio_buffer.h +++ b/engines/titanic/sound/audio_buffer.h @@ -34,6 +34,16 @@ class CAudioBuffer { private: Common::Mutex _mutex; FixedQueue _data; +private: + /** + * Enters a critical section + */ + void enterCriticalSection(); + + /** + * Leave a critical section + */ + void leaveCriticalSection(); public: bool _finished; public: @@ -80,14 +90,9 @@ public: int16 pop(); /** - * Enters a critical section - */ - void enterCriticalSection(); - - /** - * Leave a critical section + * Reads out a specified number of samples */ - void leaveCriticalSection(); + int read(int16 *values, int count); }; } // End of namespace Titanic -- cgit v1.2.3