Bug 1450845 - MediaDecoderStateMachine now ignores SeekToNextFrame if already seeking. r=jya

SeekToNextFrame is handled differently than other seeks by the
MediaDecoderStateMachine, and should not take place while other seeks already
are. Bug 1410225 implemented some changes in HTMLMediaElement to prevent this,
but it's still possible to move to a seeking state in the MDSM and accept
SeekToNextFrame (as in this bug).

This changeset changes the MDSM to reject SeekToNextFrame if a seek is already
happening. Since the MDSM now does this the changes from bug 1410225 can be
removed.

This has the functional change of the promise from SeekToNextFrame being
rejected if the seek in not performed due to another seek. Previously the
promise would succeed when the other seek completed. This seems sensible as the
next frame seek does not actually take place.

MozReview-Commit-ID: HD9WRFq3LZV
This commit is contained in:
Bryce Van Dyk
2018-06-06 15:17:30 -04:00
parent ff04854902
commit 3760dd6471
2 changed files with 15 additions and 6 deletions

View File

@@ -2720,12 +2720,6 @@ HTMLMediaElement::FastSeek(double aTime, ErrorResult& aRv)
already_AddRefed<Promise>
HTMLMediaElement::SeekToNextFrame(ErrorResult& aRv)
{
if (mSeekDOMPromise) {
// We can't perform NextFrameSeek while seek is already in action.
// Just return the pending seek promise.
return do_AddRef(mSeekDOMPromise);
}
/* This will cause JIT code to be kept around longer, to help performance
* when using SeekToNextFrame to iterate through every frame of a video.
*/