Bug 1283370. Part 2 - remove unnecessary checks for HasVideo() for we assert it in the constructor. r=kaku
authorJW Wang <jwwang@mozilla.com>
Thu, 30 Jun 2016 17:34:31 +0800
changeset 384953 933fa4644790ac56978b1d31c6a0902637d4e1f6
parent 384952 f08c25ed6e872382d062cfe4031536c10074968a
child 384954 030c194e154d3c09d5467904f8e457e9851c3154
push id22385
push userbmo:wpan@mozilla.com
push dateThu, 07 Jul 2016 12:18:17 +0000
reviewerskaku
bugs1283370
milestone50.0a1
Bug 1283370. Part 2 - remove unnecessary checks for HasVideo() for we assert it in the constructor. r=kaku MozReview-Commit-ID: 5wfWmgtdgQw
dom/media/NextFrameSeekTask.cpp
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -189,17 +189,17 @@ NextFrameSeekTask::Seek(const media::Tim
   SeekTaskResolveValue val = {};  // Zero-initialize data members.
   return SeekTask::SeekTaskPromise::CreateAndResolve(val, __func__);
 }
 
 bool
 NextFrameSeekTask::IsVideoDecoding() const
 {
   AssertOwnerThread();
-  return HasVideo() && !mIsVideoQueueFinished;
+  return !mIsVideoQueueFinished;
 }
 
 nsresult
 NextFrameSeekTask::EnsureVideoDecodeTaskQueued()
 {
   AssertOwnerThread();
   SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
              IsVideoDecoding(), VideoRequestStatus());
@@ -254,28 +254,28 @@ NextFrameSeekTask::IsAudioSeekComplete()
 
 bool
 NextFrameSeekTask::IsVideoSeekComplete()
 {
   AssertOwnerThread();
   SAMPLE_LOG("IsVideoSeekComplete() curTarVal=%d vqFin=%d vqSz=%d",
       mSeekJob.Exists(), mIsVideoQueueFinished, !!mSeekedVideoData);
 
-  return !HasVideo() || mIsVideoQueueFinished || mSeekedVideoData;
+  return mIsVideoQueueFinished || mSeekedVideoData;
 }
 
 void
 NextFrameSeekTask::CheckIfSeekComplete()
 {
   AssertOwnerThread();
 
   const bool audioSeekComplete = IsAudioSeekComplete();
 
   const bool videoSeekComplete = IsVideoSeekComplete();
-  if (HasVideo() && !videoSeekComplete) {
+  if (!videoSeekComplete) {
     // We haven't reached the target. Ensure we have requested another sample.
     if (NS_FAILED(EnsureVideoDecodeTaskQueued())) {
       DECODER_WARN("Failed to request video during seek");
       RejectIfExist(__func__);
     }
   }
 
   SAMPLE_LOG("CheckIfSeekComplete() audioSeekComplete=%d videoSeekComplete=%d",