Bug 1049317 - Simplify SourceBufferResource::ReadFromCache. r=cajbir
authorMatthew Gregan <kinetik@flim.org>
Mon, 11 Aug 2014 13:21:17 +1200
changeset 198810 e39901ab943017cda7dae1a02515236b2500d609
parent 198809 b912d66f27d5324584d6c8cba18846f64b048d8a
child 198811 c31b14487caf4210e2a8bcb5510a436263b081f1
push id47494
push usermgregan@mozilla.com
push dateMon, 11 Aug 2014 02:06:55 +0000
treeherdermozilla-inbound@c9c9e94945fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs1049317
milestone34.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 1049317 - Simplify SourceBufferResource::ReadFromCache. r=cajbir
content/media/mediasource/SourceBufferResource.cpp
--- a/content/media/mediasource/SourceBufferResource.cpp
+++ b/content/media/mediasource/SourceBufferResource.cpp
@@ -113,22 +113,17 @@ SourceBufferResource::Seek(int32_t aWhen
   mon.NotifyAll();
 
   return NS_OK;
 }
 
 nsresult
 SourceBufferResource::ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount)
 {
-  ReentrantMonitorAutoEnter mon(mMonitor);
-  nsresult rv = Seek(nsISeekableStream::NS_SEEK_SET, aOffset);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  return Read(aBuffer, aCount, nullptr);
+  return ReadAt(aOffset, aBuffer, aCount, nullptr);
 }
 
 bool
 SourceBufferResource::EvictData(uint32_t aThreshold)
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
   return mInputBuffer.Evict(mOffset, aThreshold);
 }