Bug 837842 - Make WMFByteStream::GetCapabilities() on report partially download if MediaResource is not fully cached. r=padenot
authorChris Pearce <cpearce@mozilla.com>
Mon, 11 Feb 2013 11:31:43 +1300
changeset 121479 1ff7a764c2a9fcaaec2c6b254a86832c1bdf4fca
parent 121478 a4257f41a6edc1eaf62b482c91ebe605dcd9b2d3
child 121480 1c2e7ae47afcdb65aea913365be867abf7327a8a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerspadenot
bugs837842
milestone21.0a1
Bug 837842 - Make WMFByteStream::GetCapabilities() on report partially download if MediaResource is not fully cached. r=padenot
content/media/wmf/WMFByteStream.cpp
--- a/content/media/wmf/WMFByteStream.cpp
+++ b/content/media/wmf/WMFByteStream.cpp
@@ -418,19 +418,20 @@ WMFByteStream::Flush()
 
 STDMETHODIMP
 WMFByteStream::GetCapabilities(DWORD *aCapabilities)
 {
   LOG("WMFByteStream::GetCapabilities()");
   NS_ENSURE_TRUE(aCapabilities, E_POINTER);
   ReentrantMonitorAutoEnter mon(mReentrantMonitor);
   bool seekable = mResource->IsTransportSeekable();
+  bool cached = mResource->IsDataCachedToEndOfResource(0);
   *aCapabilities = MFBYTESTREAM_IS_READABLE |
                    MFBYTESTREAM_IS_SEEKABLE |
-                   MFBYTESTREAM_IS_PARTIALLY_DOWNLOADED |
+                   (!cached ? MFBYTESTREAM_IS_PARTIALLY_DOWNLOADED : 0) |
                    (!seekable ? MFBYTESTREAM_HAS_SLOW_SEEK : 0);
   return S_OK;
 }
 
 STDMETHODIMP
 WMFByteStream::GetCurrentPosition(QWORD *aPosition)
 {
   NS_ENSURE_TRUE(aPosition, E_POINTER);