From 3c09c78aabcb9d314dfb400258fb99a37c7b50c9 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Mon, 29 Dec 2014 18:39:32 -0800 Subject: Event driven wake for AudioTrackThread notification changes Used for setMarkerPosition and setPositionUpdatePeriod. Change-Id: I0d94b929438a5cd94b295d7c1884f876fae8b5e7 --- include/media/AudioTrack.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index c995bd2..d602ee4 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -614,6 +614,7 @@ protected: void pause(); // suspend thread from execution at next loop boundary void resume(); // allow thread to execute, if not requested to exit + void wake(); // wake to handle changed notification conditions. private: void pauseInternal(nsecs_t ns = 0LL); @@ -628,7 +629,9 @@ protected: bool mPaused; // whether thread is requested to pause at next loop entry bool mPausedInt; // whether thread internally requests pause nsecs_t mPausedNs; // if mPausedInt then associated timeout, otherwise ignored - bool mIgnoreNextPausedInt; // whether to ignore next mPausedInt request + bool mIgnoreNextPausedInt; // skip any internal pause and go immediately + // to processAudioBuffer() as state may have changed + // since pause time calculated. }; // body of AudioTrackThread::threadLoop() -- cgit v1.1