Bug 1324371. Part 3 - inline IsVideoRequestPending() which has only one caller. r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Mon, 19 Dec 2016 17:03:16 +0800
changeset 451473 0254b1fe43dab26dcc5eb003304eef724cc30e64
parent 451472 e95c654f4ef55f6813bd978ec1c0ceadf0a70b30
child 451474 20576875dc3a50170fdb6081d4ec4e9d698bff8a
push id39197
push userjwwang@mozilla.com
push dateTue, 20 Dec 2016 12:45:19 +0000
reviewerskaku
bugs1324371
milestone53.0a1
Bug 1324371. Part 3 - inline IsVideoRequestPending() which has only one caller. r?kaku MozReview-Commit-ID: 7bBDRQV9zJ1
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1273,17 +1273,19 @@ public:
 private:
   void DoSeekInternal()
   {
     auto currentTime = mCurrentTime;
     DiscardFrames(VideoQueue(), [currentTime] (int64_t aSampleTime) {
       return aSampleTime <= currentTime;
     });
 
-    if (!IsVideoRequestPending() && NeedMoreVideo()) {
+    if (NeedMoreVideo() &&
+        !Reader()->IsRequestingVideoData() &&
+        !Reader()->IsWaitingVideoData()) {
       RequestVideoData();
     }
 
     MaybeFinishSeek(); // Might resolve mSeekTaskPromise and modify audio queue.
   }
 
   class AysncNextFrameSeekTask : public Runnable
   {
@@ -1446,21 +1448,16 @@ private:
 
   bool NeedMoreVideo() const
   {
     // Need to request video when we have none and video queue is not finished.
     return VideoQueue().GetSize() == 0 &&
            !VideoQueue().IsFinished();
   }
 
-  bool IsVideoRequestPending() const
-  {
-    return Reader()->IsRequestingVideoData() || Reader()->IsWaitingVideoData();
-  }
-
   // Update the seek target's time before resolving this seek task, the updated
   // time will be used in the MDSM::SeekCompleted() to update the MDSM's position.
   void UpdateSeekTargetTime()
   {
     RefPtr<MediaData> data = VideoQueue().PeekFront();
     if (data) {
       mSeekJob.mTarget->SetTime(TimeUnit::FromMicroseconds(data->mTime));
     } else if (VideoQueue().AtEndOfStream()) {