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 id24291
push userryanvm@gmail.com
push dateMon, 11 Feb 2013 19:12:51 +0000
treeherdermozilla-central@93ba23f414ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs837842
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);