Bug 1362165: P7. Only complete appendBuffer once readyState has changed. r=jwwang

MSE specs require that the readyState be modified during either the Initialization Segment Received or the Coded Frame Processing algorithms.

At this stage, we only handle the Initialization Segment part (readyState moving from HAVE_NOTHING to HAVE_METADATA)

MozReview-Commit-ID: KBnnWuHJ6Om
This commit is contained in:
Jean-Yves Avenard
2017-05-09 12:23:11 +02:00
parent d2d360aa81
commit 20c79a5e0d
5 changed files with 68 additions and 5 deletions

View File

@@ -1658,6 +1658,9 @@ void HTMLMediaElement::ShutdownDecoder()
RemoveMediaElementFromURITable();
NS_ASSERTION(mDecoder, "Must have decoder to shut down");
mWaitingForKeyListener.DisconnectIfExists();
if (mMediaSource) {
mMediaSource->CompletePendingTransactions();
}
mDecoder->Shutdown();
mDecoder = nullptr;
}
@@ -5583,6 +5586,12 @@ HTMLMediaElement::UpdateReadyStateInternal()
MetadataLoaded(&mediaInfo, nsAutoPtr<const MetadataTags>(nullptr));
}
if (mMediaSource) {
// readyState has changed, assuming it's following the pending mediasource
// operations. Notify the Mediasource that the operations have completed.
mMediaSource->CompletePendingTransactions();
}
enum NextFrameStatus nextFrameStatus = NextFrameStatus();
if (nextFrameStatus == NEXT_FRAME_UNAVAILABLE ||
(nextFrameStatus == NEXT_FRAME_UNAVAILABLE_BUFFERING &&