diff options
author | Andreas Huber <andih@google.com> | 2010-09-28 14:01:14 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-28 14:01:14 -0700 |
commit | fb9b87b6c22d940e5e7cb4b5e7cfae99015a0131 (patch) | |
tree | 8a0b4c0862f1c4e9771af53e9705efc998e23b92 /media/libstagefright/AwesomePlayer.cpp | |
parent | 8267b65adcfd944c3f465425183ad7f38b0999e5 (diff) | |
parent | 10d64915079bfb316a3949fe7fa35dca37a92af4 (diff) | |
download | frameworks_av-fb9b87b6c22d940e5e7cb4b5e7cfae99015a0131.zip frameworks_av-fb9b87b6c22d940e5e7cb4b5e7cfae99015a0131.tar.gz frameworks_av-fb9b87b6c22d940e5e7cb4b5e7cfae99015a0131.tar.bz2 |
am d6c30e8c: am be045061: Merge "Instead of constantly polling the AudioPlayer to see if it reached EOS or finished seeking, initiate the notification from the AudioPlayer when the event happens." into gingerbread
Merge commit 'd6c30e8c1521bc584f33500b8ee897dafdfec023'
* commit 'd6c30e8c1521bc584f33500b8ee897dafdfec023':
Instead of constantly polling the AudioPlayer to see if it reached EOS or finished seeking, initiate the notification from the AudioPlayer when the event happens.
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index fd5f30b..97c9003 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -642,7 +642,7 @@ status_t AwesomePlayer::play_l() { if (mAudioSource != NULL) { if (mAudioPlayer == NULL) { if (mAudioSink != NULL) { - mAudioPlayer = new AudioPlayer(mAudioSink); + mAudioPlayer = new AudioPlayer(mAudioSink, this); mAudioPlayer->setSource(mAudioSource); // We've already started the MediaSource in order to enable @@ -669,8 +669,6 @@ status_t AwesomePlayer::play_l() { } else { mAudioPlayer->resume(); } - - postCheckAudioStatusEvent_l(); } if (mTimeSource == NULL && mAudioPlayer == NULL) { @@ -1191,7 +1189,7 @@ void AwesomePlayer::postCheckAudioStatusEvent_l() { return; } mAudioStatusEventPending = true; - mQueue.postEventWithDelay(mCheckAudioStatusEvent, 100000ll); + mQueue.postEvent(mCheckAudioStatusEvent); } void AwesomePlayer::onCheckAudioStatus() { @@ -1222,8 +1220,6 @@ void AwesomePlayer::onCheckAudioStatus() { mFlags |= FIRST_FRAME; postStreamDoneEvent_l(finalStatus); } - - postCheckAudioStatusEvent_l(); } status_t AwesomePlayer::prepare() { @@ -1685,5 +1681,13 @@ uint32_t AwesomePlayer::flags() const { return mExtractorFlags; } +void AwesomePlayer::postAudioEOS() { + postCheckAudioStatusEvent_l(); +} + +void AwesomePlayer::postAudioSeekComplete() { + postCheckAudioStatusEvent_l(); +} + } // namespace android |