Bug 1270323: P2. Don't process new incoming data while a skip to next keyframe is pending. r?cpearce draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sat, 21 May 2016 23:02:43 +0800
changeset 369995 f319d11d743d8fccd12c5d2c65478e5ce1b88269
parent 369994 b07bda8ddea67518f919d3bbe82694943dfef28a
child 369996 f712770a2b455ab4b96d3ef74110219b368bebc4
push id18971
push userbmo:jyavenard@mozilla.com
push dateTue, 24 May 2016 03:18:45 +0000
reviewerscpearce
bugs1270323, 1272964
milestone49.0a1
Bug 1270323: P2. Don't process new incoming data while a skip to next keyframe is pending. r?cpearce Followup from bug 1272964 P4. MozReview-Commit-ID: 18MC3O1JZLv
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -796,16 +796,22 @@ MediaFormatReader::UpdateReceivedNewData
   // demuxing or seeking operations that could affect the value of this flag.
   // This is in order to ensure that we will retry once they complete as we may
   // now have new data that could potentially allow those operations to
   // successfully complete if tried again.
   if (decoder.mSeekRequest.Exists()) {
     // Nothing more to do until this operation complete.
     return true;
   }
+
+  if (aTrack == TrackType::kVideoTrack && mSkipRequest.Exists()) {
+    LOGV("Skipping in progress, nothing more to do");
+    return true;
+  }
+
   if (decoder.mDemuxRequest.Exists()) {
     // We may have pending operations to process, so we want to continue
     // after UpdateReceivedNewData returns.
     return false;
   }
 
   if (decoder.mDrainComplete || decoder.mDraining) {
     // We do not want to clear mWaitingForData or mDemuxEOS while
@@ -1098,21 +1104,16 @@ MediaFormatReader::Update(TrackType aTra
   bool needOutput = false;
   auto& decoder = GetDecoderData(aTrack);
   decoder.mUpdateScheduled = false;
 
   if (!mInitDone) {
     return;
   }
 
-  if (aTrack == TrackType::kVideoTrack && mSkipRequest.Exists()) {
-    LOGV("Skipping in progress, nothing more to do");
-    return;
-  }
-
   if (UpdateReceivedNewData(aTrack)) {
     LOGV("Nothing more to do");
     return;
   }
 
   if (decoder.mSeekRequest.Exists()) {
     LOGV("Seeking hasn't completed, nothing more to do");
     return;