Bug 1410225 - return the pending seek promise for SeekToNextFrame() when a seek is already in action.
MDSM doesn't reset the decoding pipeline of MFR when doing NextFrameSeek and
therefore fails the assertion by requesting video data while MFR is still seeking.
We put the fix in the media element because it doesn't make sense to do
NextFrameSeek while another seek is already in action.
MozReview-Commit-ID: D6FSiNWHrLU
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2677,16 +2677,22 @@ HTMLMediaElement::FastSeek(double aTime,
LOG(LogLevel::Debug, ("Reporting telemetry VIDEO_FASTSEEK_USED"));
Telemetry::Accumulate(Telemetry::VIDEO_FASTSEEK_USED, 1);
RefPtr<Promise> tobeDropped = Seek(aTime, SeekTarget::PrevSyncPoint, 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.
*/
nsCOMPtr<nsIGlobalObject> global =
do_QueryInterface(OwnerDoc()->GetInnerWindow());
if (global) {
if (JSObject *obj = global->GetGlobalJSObject()) {