From 1862a33b246249630b654182afb5914da3480d4c Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 3 Feb 2010 11:37:29 -0800 Subject: Fix a deadlock caused by the AudioPlayer notifying the observer that the stream had ended at the same time the observer was shutting down the AudioPlayer. related-to-bug: 2414536 --- include/media/stagefright/AudioPlayer.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h index 26fcc95..843e051 100644 --- a/include/media/stagefright/AudioPlayer.h +++ b/include/media/stagefright/AudioPlayer.h @@ -41,9 +41,6 @@ public: // Caller retains ownership of "source". void setSource(const sp &source); - void setListenerCallback( - void (*notify)(void *cookie, int what), void *cookie); - // Return time in us. virtual int64_t getRealTimeUs(); @@ -63,6 +60,9 @@ public: status_t seekTo(int64_t time_us); + bool isSeeking(); + bool reachedEOS(); + private: sp mSource; AudioTrack *mAudioTrack; @@ -80,13 +80,11 @@ private: int64_t mPositionTimeRealUs; bool mSeeking; + bool mReachedEOS; int64_t mSeekTimeUs; bool mStarted; - void (*mListenerCallback)(void *cookie, int what); - void *mListenerCookie; - sp mAudioSink; static void AudioCallback(int event, void *user, void *info); -- cgit v1.1