Bug 1120023 - Switch SourceBufferResource::Read{,At} back to blocking. r=cpearce
authorBobby Holley <bobbyholley@gmail.com>
Sat, 10 Jan 2015 02:05:28 -0800
changeset 223172 9de247dc316174bd7c35d1e7449a82a5318cc153
parent 223171 677f21c77f7e092f4187342f43694c55463c164d
child 223173 47671b5f66ab8182bebfe255f946b500cab65908
push id10769
push usercbook@mozilla.com
push dateMon, 12 Jan 2015 14:15:52 +0000
treeherderfx-team@0e9765732906 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1120023
milestone37.0a1
Bug 1120023 - Switch SourceBufferResource::Read{,At} back to blocking. r=cpearce 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);