Bug 784932 - Allow HTMLMediaElement.buffered to be read when readyState > HAVE_NOTHING instead of > HAVE_METADATA. r=roc
authorChris Pearce <cpearce@mozilla.com>
Mon, 27 Aug 2012 20:30:29 +1200
changeset 105579 b3fde74539de8ea3e44ad707416de4caacfbad4f
parent 105578 6c6a080be434b81d8189de2ff2389376a1615a57
child 105580 f3fa6d8742ffe6f91aacb77f73945d441dc1dfdf
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersroc
bugs784932
milestone17.0a1
Bug 784932 - Allow HTMLMediaElement.buffered to be read when readyState > HAVE_NOTHING instead of > HAVE_METADATA. r=roc
content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -3424,17 +3424,17 @@ nsHTMLMediaElement::CopyInnerTo(nsGeneri
     }
   }
   return rv;
 }
 
 nsresult nsHTMLMediaElement::GetBuffered(nsIDOMTimeRanges** aBuffered)
 {
   nsRefPtr<nsTimeRanges> ranges = new nsTimeRanges();
-  if (mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA && mDecoder) {
+  if (mReadyState > nsIDOMHTMLMediaElement::HAVE_NOTHING && mDecoder) {
     // If GetBuffered fails we ignore the error result and just return the
     // time ranges we found up till the error.
     mDecoder->GetBuffered(ranges);
   }
   ranges.forget(aBuffered);
   return NS_OK;
 }