OSDN Git Service

Start sending out buffering updates earlier (after preparation has completed) instead...
authorAndreas Huber <andih@google.com>
Mon, 12 Apr 2010 16:41:12 +0000 (09:41 -0700)
committerAndreas Huber <andih@google.com>
Mon, 12 Apr 2010 16:41:12 +0000 (09:41 -0700)
Change-Id: Ieaa90cc9b54bd56963aa5f4daced2ba243801acf
related-to-bug: 2585913

media/libstagefright/AwesomePlayer.cpp

index 63dfa67..c1987dc 100644 (file)
@@ -444,6 +444,8 @@ void AwesomePlayer::onBufferingUpdate() {
         notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage * 100.0);
 
         postBufferingEvent_l();
+    } else {
+        LOGE("Not sending buffering status because duration is unknown.");
     }
 }
 
@@ -552,8 +554,6 @@ status_t AwesomePlayer::play_l() {
         seekAudioIfNecessary_l();
     }
 
-    postBufferingEvent_l();
-
     if (mFlags & AT_EOS) {
         // Legacy behaviour, if a stream finishes playing and then
         // is started again, we play from the start...
@@ -1225,6 +1225,8 @@ void AwesomePlayer::onPrepareAsyncEvent() {
     mFlags |= PREPARED;
     mAsyncPrepareEvent = NULL;
     mPreparedCondition.broadcast();
+
+    postBufferingEvent_l();
 }
 
 status_t AwesomePlayer::suspend() {