Bug 1283785. Part 1 - remove the IsVideoRequestPending() check from EnsureVideoDecodeTaskQueued() r=kaku draft
authorJW Wang <jwwang@mozilla.com>
Fri, 01 Jul 2016 17:49:25 +0800
changeset 386517 29941e0e2a450db572f84d22de9707eeb250d6e9
parent 386505 f6a7ac45914958f4e8e7495f4f2c5342cca172c7
child 386518 620175f87586075625ae3f57911f8f291a5320aa
push id22731
push userjwwang@mozilla.com
push dateTue, 12 Jul 2016 05:50:43 +0000
reviewerskaku
bugs1283785
milestone50.0a1
Bug 1283785. Part 1 - remove the IsVideoRequestPending() check from EnsureVideoDecodeTaskQueued() r=kaku 1. EnsureVideoDecodeTaskQueued() is called from video callbaks where IsVideoRequestPending() is false. 2. EnsureVideoDecodeTaskQueued() is called from Seek() which checks IsVideoRequestPending() is false. MozReview-Commit-ID: 59qu0Gh6nK7
dom/media/NextFrameSeekTask.cpp
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -112,17 +112,17 @@ NextFrameSeekTask::Seek(const media::Tim
   AssertOwnerThread();
 
   auto currentTime = mCurrentTime;
   DiscardFrames(mVideoQueue, [currentTime] (int64_t aSampleTime) {
     return aSampleTime <= currentTime;
   });
 
   RefPtr<SeekTaskPromise> promise = mSeekTaskPromise.Ensure(__func__);
-  if (NeedMoreVideo()) {
+  if (!IsVideoRequestPending() && NeedMoreVideo()) {
     EnsureVideoDecodeTaskQueued();
   }
   MaybeFinishSeek(); // Might resolve mSeekTaskPromise and modify audio queue.
   return promise;
 }
 
 bool
 NextFrameSeekTask::IsVideoDecoding() const
@@ -133,17 +133,17 @@ NextFrameSeekTask::IsVideoDecoding() con
 
 void
 NextFrameSeekTask::EnsureVideoDecodeTaskQueued()
 {
   AssertOwnerThread();
   SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
              IsVideoDecoding(), VideoRequestStatus());
 
-  if (!IsVideoDecoding() || IsVideoRequestPending()) {
+  if (!IsVideoDecoding()) {
     return;
   }
 
   RequestVideoData();
 }
 
 const char*
 NextFrameSeekTask::VideoRequestStatus()