Bug 1267036: Force recalculation of readyState when download is progressing. r=jwwang a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 24 Apr 2016 23:34:23 +1000
changeset 332813 7772a4493512048d88004e020e1a13eda7a6d857
parent 332812 4c5959b81fd5b61fe854f2d2e0743afa66f9aa07
child 332814 7d65f322abdbd49af0b4b12267de5123b672b4ff
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang, ritu
bugs1267036
milestone48.0a2
Bug 1267036: Force recalculation of readyState when download is progressing. r=jwwang a=ritu Under some circumstances, the MP3Demuxer is unable to calculate the buffered range which would prevent the readyState value to be recalculated. To get around this we force recalculation when the progress event is fired. MozReview-Commit-ID: DTaxJjOX4JU
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3829,16 +3829,18 @@ void HTMLMediaElement::CheckProgress(boo
       NS_ASSERTION(aHaveNewProgress,
                    "timer dispatched when there was no timer");
       // Were stalled.  Restart timer.
       StartProgressTimer();
       if (!mLoadedDataFired) {
         ChangeDelayLoadStatus(true);
       }
     }
+    // Download statistics may have been updated, force a recheck of the readyState.
+    UpdateReadyStateInternal();
   }
 
   if (now - mDataTime >= TimeDuration::FromMilliseconds(STALL_MS)) {
     DispatchAsyncEvent(NS_LITERAL_STRING("stalled"));
 
     if (mMediaSource) {
       ChangeDelayLoadStatus(false);
     }