OSDN Git Service

rtsp: fix StopBuffering condition in monitor
authorRobert Shih <robertshih@google.com>
Mon, 1 Aug 2016 23:26:58 +0000 (16:26 -0700)
committerRobert Shih <robertshih@google.com>
Sat, 27 Aug 2016 01:59:27 +0000 (01:59 +0000)
Stop buffering once there is sufficient data on all tracks.

Bug: 30230942
Change-Id: Iae484a4aab720c0bd70e0c122fd87e8237156019
(cherry picked from commit 91ea571836401ba77854d7b3aefb3ccee9c20eb3)

media/libmediaplayerservice/nuplayer/RTSPSource.cpp

index 8a305de..901f636 100644 (file)
@@ -369,8 +369,11 @@ void NuPlayer::RTSPSource::onPollBuffering() {
         startBufferingIfNecessary();
     }
 
-    if (overflow && mHandler != NULL) {
+    if (haveSufficientDataOnAllTracks()) {
         stopBufferingIfNecessary();
+    }
+
+    if (overflow && mHandler != NULL) {
         mHandler->pause();
     }