Bug 1429280 - the seeking target of exiting dormant should be adjusted by looping. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 10 Jan 2018 17:26:17 +0800
changeset 718889 3862107cde3024783a9f944ae27d11fd76797b44
parent 718888 5b1f14dc8f329725fd1c3de0030e20d6f1205979
child 745629 a17a2de6a09c9f1a493b40b36e29c70b93eed14c
push id95079
push userjwwang@mozilla.com
push dateThu, 11 Jan 2018 02:16:27 +0000
bugs1429280
milestone59.0a1
Bug 1429280 - the seeking target of exiting dormant should be adjusted by looping. Otherwise we will seek to a position beyond the duration when exiting dormant which will fail an assertion in OggDemuxer. MozReview-Commit-ID: FPWKyd8APrj
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -405,16 +405,17 @@ public:
   {
     if (mMaster->IsPlaying()) {
       mMaster->StopPlayback();
     }
 
     // Calculate the position to seek to when exiting dormant.
     auto t = mMaster->mMediaSink->IsStarted()
       ? mMaster->GetClock() : mMaster->GetMediaTime();
+    Reader()->AdjustByLooping(t);
     mPendingSeek.mTarget.emplace(t, SeekTarget::Accurate);
     // SeekJob asserts |mTarget.IsValid() == !mPromise.IsEmpty()| so we
     // need to create the promise even it is not used at all.
     // The promise may be used when coming out of DormantState into
     // SeekingState.
     RefPtr<MediaDecoder::SeekPromise> x =
       mPendingSeek.mPromise.Ensure(__func__);