Bug 1065827 - Do not always wait to decode frames to emit loadedmetadata. r=jwwang

This commit is contained in:
Jean-Yves Avenard
2014-11-06 20:52:44 +11:00
parent f4cad31fff
commit 5eb27a9942
16 changed files with 338 additions and 77 deletions

View File

@@ -2903,11 +2903,11 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
// If this element had a video track, but consists only of an audio track now,
// delete the VideoFrameContainer. This happens when the src is changed to an
// audio only file.
if (!aInfo->HasVideo() && mVideoFrameContainer) {
// call ForgetElement() such that callbacks from |mVideoFrameContainer|
// won't reach us anymore.
mVideoFrameContainer->ForgetElement();
mVideoFrameContainer = nullptr;
// Else update its dimensions.
if (!aInfo->HasVideo()) {
ResetState();
} else {
UpdateMediaSize(aInfo->mVideo.mDisplay);
}
}