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 326217 5220d6bc3ffdaf439fa298667855b5d196c134d1
parent 326216 082a714bd4304cf11109664584feb22b67a25408
child 326218 d9d2ae31af3a929151b8319089ead1ab68544d9f
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang, ritu
bugs1267036
milestone47.0
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
@@ -3657,16 +3657,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);
     }