Bug 1423241 - Hold back readyState while no frame has been displayed as intended. r=jya
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 23 Nov 2018 15:01:24 +0000
changeset 504268 e93cc0185c24c792da94717583a37b28ebcd24be
parent 504267 720f409b83f27d5c92c9194157b6f7ac65068361
child 504269 fafb582ffcbc071acbc32dfe450be0df7ee84f23
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1423241
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1423241 - Hold back readyState while no frame has been displayed as intended. r=jya HasVideo() might be false even though there is a video track present as it will only look at the resolution of a VideoTrack. Differential Revision: https://phabricator.services.mozilla.com/D9103
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -6065,18 +6065,20 @@ HTMLMediaElement::UpdateReadyStateIntern
     LOG(LogLevel::Debug,
         ("MediaElement %p UpdateReadyStateInternal() "
          "NEXT_FRAME_UNAVAILABLE_SEEKING; Forcing HAVE_METADATA",
          this));
     ChangeReadyState(HAVE_METADATA);
     return;
   }
 
-  if (IsVideo() && HasVideo() && !IsPlaybackEnded() && GetImageContainer() &&
-      !GetImageContainer()->HasCurrentImage()) {
+  if (IsVideo() &&
+      VideoTracks() && !VideoTracks()->IsEmpty() &&
+      !IsPlaybackEnded() &&
+      GetImageContainer() && !GetImageContainer()->HasCurrentImage()) {
     // Don't advance if we are playing video, but don't have a video frame.
     // Also, if video became available after advancing to HAVE_CURRENT_DATA
     // while we are still playing, we need to revert to HAVE_METADATA until
     // a video frame is available.
     LOG(LogLevel::Debug,
         ("MediaElement %p UpdateReadyStateInternal() "
          "Playing video but no video frame; Forcing HAVE_METADATA",
          this));