Bug 1120023 - Switch SourceBufferResource::Read{,At} back to blocking. r=cpearce, a=sledru
authorBobby Holley <bobbyholley@gmail.com>
Sat, 10 Jan 2015 02:05:28 -0800
changeset 242863 423cb20b5f43
parent 242862 e5cc2f8f3f7e
child 242864 c7e58ab0e1f6
push id4322
push userryanvm@gmail.com
push date2015-01-14 15:18 +0000
treeherdermozilla-beta@82cce51fb174 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1120023
milestone36.0
Bug 1120023 - Switch SourceBufferResource::Read{,At} back to blocking. r=cpearce, a=sledru This only affects WebM MSE, which, as it turns out, doesn't deal well with non-blocking read (MP4Reader now only operates on cached reads). We should fix up WebM at some point, but I'm reverting the behavior change for now because it's pretty much just a distraction.
dom/media/mediasource/SourceBufferResource.cpp
--- a/dom/media/mediasource/SourceBufferResource.cpp
+++ b/dom/media/mediasource/SourceBufferResource.cpp
@@ -44,17 +44,17 @@ SourceBufferResource::Close()
 
 nsresult
 SourceBufferResource::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
 {
   SBR_DEBUGV("SourceBufferResource(%p)::Read(aBuffer=%p, aCount=%u, aBytes=%p)",
              this, aBytes, aCount, aBytes);
   ReentrantMonitorAutoEnter mon(mMonitor);
 
-  return ReadInternal(aBuffer, aCount, aBytes, /* aMayBlock = */ !aBytes);
+  return ReadInternal(aBuffer, aCount, aBytes, /* aMayBlock = */ true);
 }
 
 nsresult
 SourceBufferResource::ReadInternal(char* aBuffer, uint32_t aCount, uint32_t* aBytes, bool aMayBlock)
 {
   mMonitor.AssertCurrentThreadIn();
   MOZ_ASSERT_IF(!aMayBlock, aBytes);
 
@@ -92,17 +92,17 @@ SourceBufferResource::ReadInternal(char*
 }
 
 nsresult
 SourceBufferResource::ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes)
 {
   SBR_DEBUG("SourceBufferResource(%p)::ReadAt(aOffset=%lld, aBuffer=%p, aCount=%u, aBytes=%p)",
             this, aOffset, aBytes, aCount, aBytes);
   ReentrantMonitorAutoEnter mon(mMonitor);
-  return ReadAtInternal(aOffset, aBuffer, aCount, aBytes, /* aMayBlock = */ !aBytes);
+  return ReadAtInternal(aOffset, aBuffer, aCount, aBytes, /* aMayBlock = */ true);
 }
 
 nsresult
 SourceBufferResource::ReadAtInternal(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes,
                                      bool aMayBlock)
 {
   mMonitor.AssertCurrentThreadIn();
   nsresult rv = SeekInternal(aOffset);