Bug 687972. Make sure that if ResourceLoaded fires before MetadataLoaded, we go to HAVE_ENOUGH_DATA when MetadataLoaded eventually fires. r=cpearce

This commit is contained in:
Robert O'Callahan 2011-11-30 11:04:38 +13:00
parent 8e92cfdc4c
commit 1171f7cdd0

View File

@ -2064,6 +2064,10 @@ void nsHTMLMediaElement::MetadataLoaded(PRUint32 aChannels, PRUint32 aRate)
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
DispatchAsyncEvent(NS_LITERAL_STRING("loadedmetadata"));
if (!mBegun) {
// Something ended our downloaded. We're probably done with downloading already.
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
}
if (mDecoder && mDecoder->IsSeekable()) {
ProcessMediaFragmentURI();
mDecoder->SetEndTime(mFragmentEnd);