Bug 1313955 - Dormant recovery seek uses wrong time. r=jwwang
authorDan Glastonbury <dglastonbury@mozilla.com>
Tue, 01 Nov 2016 10:04:04 +1000
changeset 347138 a8211df712a7e01999d0256aa8e5b1ec7a9c1ea3
parent 347137 53b4f35c5830850f9609a451a139bffcf93233c2
child 347139 4401660ffb9a42bc47a60e0370ad116efced81d7
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1313955
milestone52.0a1
Bug 1313955 - Dormant recovery seek uses wrong time. r=jwwang Dormant mode is setting recovery seek to MDSM::mCurrentPosition which doesn't match what MediaSink position which is used to leave the last frame in the image container. Switch to using mMediaSink->GetPosition for dormant recovery seek target. MozReview-Commit-ID: 7YLecRR8XrN
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1143,17 +1143,20 @@ public:
 bool
 MediaDecoderStateMachine::
 StateObject::HandleDormant(bool aDormant)
 {
   if (!aDormant) {
     return true;
   }
   SeekJob seekJob;
-  seekJob.mTarget = SeekTarget(mMaster->mCurrentPosition,
+  int64_t seekTargetTime = mMaster->mMediaSink->IsStarted()
+                           ? mMaster->GetClock() : mMaster->GetMediaTime();
+
+  seekJob.mTarget = SeekTarget(seekTargetTime,
                                SeekTarget::Accurate,
                                MediaDecoderEventVisibility::Suppressed);
   // SeekJob asserts |mTarget.IsValid() == !mPromise.IsEmpty()| so we
   // need to create the promise even it is not used at all.
   RefPtr<MediaDecoder::SeekPromise> unused = seekJob.mPromise.Ensure(__func__);
   SetState<DormantState>(Move(seekJob));
   return true;
 }