Bug 1312886: P2. Never move past HAVE_FUTURE_DATA if we're waiting for a key, r?cpearce draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 27 Oct 2016 16:36:37 +1100
changeset 430759 f921259d51206b2fd4b16a8ed322cddb34de373b
parent 430758 a7073d5bc10324fada58e4e88e315e44cb99749f
child 430760 0a04be673e532be63c8f8996371d6eb7cf2028b5
push id33879
push userbmo:jyavenard@mozilla.com
push dateFri, 28 Oct 2016 03:36:01 +0000
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);