Bug 1296453 - [MSE] P1. Fix eviction. r=gerald, a=lizzard
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 23 Aug 2016 17:18:22 +1200
changeset 340452 cbe685bc5bc45cf9aef4f19dcca24dacc4ad4bb8
parent 340451 c56047b7ac0dabf7e7ea4492e2da12fc92981691
child 340453 4c552e7562362b5736687587d1e4375e9cdff6b3
push id6338
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 03:41:03 +0000
treeherdermozilla-beta@a84b57a1e9f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, lizzard
bugs1296453
milestone49.0
Bug 1296453 - [MSE] P1. Fix eviction. r=gerald, a=lizzard The MP4 demuxer returns INT64_MAX when all data can be safely evicted from the MediaResource. Additionally, the MP4Demuxer will read the MediaResource using CacheReadAt. Eviction in the SourceBufferResource had a safeguard to ensure we would never evict data we hadn't read yet. This was done by keeping the position of the last data read in the mOffset member. CacheReadAt however doesn't update mOffset. As a result, no data was ever removed from the input buffer when using MP4. MozReview-Commit-ID: 2tAWzpMlOjG
dom/media/mediasource/SourceBufferResource.cpp
--- a/dom/media/mediasource/SourceBufferResource.cpp
+++ b/dom/media/mediasource/SourceBufferResource.cpp
@@ -149,20 +149,19 @@ SourceBufferResource::EvictData(uint64_t
   return result;
 }
 
 void
 SourceBufferResource::EvictBefore(uint64_t aOffset, ErrorResult& aRv)
 {
   SBR_DEBUG("EvictBefore(aOffset=%llu)", aOffset);
   ReentrantMonitorAutoEnter mon(mMonitor);
-  // If aOffset is past the current playback offset we don't evict.
-  if (aOffset < mOffset) {
-    mInputBuffer.EvictBefore(aOffset, aRv);
-  }
+
+  mInputBuffer.EvictBefore(aOffset, aRv);
+
   // Wake up any waiting threads in case a ReadInternal call
   // is now invalid.
   mon.NotifyAll();
 }
 
 uint32_t
 SourceBufferResource::EvictAll()
 {