Bug 1312886: P2. Never move past HAVE_FUTURE_DATA if we're waiting for a key, r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 27 Oct 2016 16:36:37 +1100
changeset 319921 e24a86e2fb9fb0f9a8c6b2f9c60b6f51ee4c5db1
parent 319920 246305d4d3bb6595ec24f360bee9530a16648c33
child 319922 3ffa32dd1a2b15857b6147e967134ac8d1d68502
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1312886
milestone52.0a1
Bug 1312886: P2. Never move past HAVE_FUTURE_DATA if we're waiting for a key, r=cpearce MozReview-Commit-ID: KWERB7zWXPZ
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4791,17 +4791,17 @@ HTMLMediaElement::UpdateReadyStateIntern
   // Now see if we should set HAVE_ENOUGH_DATA.
   // If it's something we don't know the size of, then we can't
   // make a real estimate, so we go straight to HAVE_ENOUGH_DATA once
   // we've downloaded enough data that our download rate is considered
   // reliable. We have to move to HAVE_ENOUGH_DATA at some point or
   // autoplay elements for live streams will never play. Otherwise we
   // move to HAVE_ENOUGH_DATA if we can play through the entire media
   // without stopping to buffer.
-  if (mDecoder->CanPlayThrough()) {
+  if (mWaitingForKey == NOT_WAITING_FOR_KEY && mDecoder->CanPlayThrough()) {
     LOG(LogLevel::Debug, ("MediaElement %p UpdateReadyStateInternal() "
                           "Decoder can play through", this));
     ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
     return;
   }
   LOG(LogLevel::Debug, ("MediaElement %p UpdateReadyStateInternal() "
                         "Default; Decoder has future data", this));
   ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA);