Bug 1312886: [MSE] P3. Only rely on waiting promise to determine buffering state. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 27 Oct 2016 20:16:30 +1100
changeset 319922 3ffa32dd1a2b15857b6147e967134ac8d1d68502
parent 319921 e24a86e2fb9fb0f9a8c6b2f9c60b6f51ee4c5db1
child 319923 be4b0b1e47335d8087edbbda63d46c8c76ce7c69
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1312886
milestone52.0a1
Bug 1312886: [MSE] P3. Only rely on waiting promise to determine buffering state. r=jwwang MozReview-Commit-ID: 3HfK8bwqlYM
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1464,24 +1464,21 @@ DecodingState::MaybeStartBuffering()
   }
 
   // Don't enter buffering while prerolling so that the decoder has a chance to
   // enqueue some decoded data before we give up and start buffering.
   if (!mMaster->IsPlaying()) {
     return;
   }
 
-  // No more data to download. No need to enter buffering.
-  if (!Resource()->IsExpectingMoreData()) {
-    return;
-  }
-
   bool shouldBuffer;
   if (Reader()->UseBufferingHeuristics()) {
-    shouldBuffer = mMaster->HasLowDecodedData() && mMaster->HasLowBufferedData();
+    shouldBuffer = Resource()->IsExpectingMoreData() &&
+                   mMaster->HasLowDecodedData() &&
+                   mMaster->HasLowBufferedData();
   } else {
     MOZ_ASSERT(Reader()->IsWaitForDataSupported());
     shouldBuffer =
       (mMaster->OutOfDecodedAudio() && Reader()->IsWaitingAudioData()) ||
       (mMaster->OutOfDecodedVideo() && Reader()->IsWaitingVideoData());
   }
   if (shouldBuffer) {
     SetState<BufferingState>();