Bug 1159343: Interrupt seek early when possible. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 24 Sep 2015 16:46:14 +1000
changeset 264153 ad2dda03780c60029ff7e2ddd6523a8970c1477b
parent 264152 708cf76b6cb44a8565d013621d7ef9f71ab3ac78
child 264154 84fd96dc7ddc5758964b3018c2e36b1431e25e0f
push id65542
push userjyavenard@mozilla.com
push dateThu, 24 Sep 2015 06:46:43 +0000
treeherdermozilla-inbound@ad2dda03780c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1159343
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1159343: Interrupt seek early when possible. r=jwwang
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -927,18 +927,20 @@ MediaDecoderStateMachine::OnVideoDecoded
           // We are doing a fastSeek, but we ended up *before* the previous
           // playback position. This is surprising UX, so switch to an accurate
           // seek and decode to the seek target. This is not conformant to the
           // spec, fastSeek should always be fast, but until we get the time to
           // change all Readers to seek to the keyframe after the currentTime
           // in this case, we'll just decode forward. Bug 1026330.
           mCurrentSeek.mTarget.mType = SeekTarget::Accurate;
         }
-        if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint) {
-          // Non-precise seek; we can stop the seek at the first sample.
+        if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint ||
+            mPendingSeek.Exists()) {
+          // Non-precise seek; or a pending seek exists ; we can stop the seek
+          // at the first sample.
           Push(video, MediaData::VIDEO_DATA);
         } else {
           // We're doing an accurate seek. We still need to discard
           // MediaData up to the one containing exact seek target.
           if (NS_FAILED(DropVideoUpToSeekTarget(video))) {
             DecodeError();
             return;
           }