Bug 1302573: [MSE] P5. Always evict data as soon as we can. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 25 Sep 2016 21:55:26 +1000
changeset 417548 04d24572b5b199a29c9656f65c5a3e333e4f1ff5
parent 417547 4e6f7b6e5bec7e76b0c146b7c5cf4024fd722ecc
child 532104 30c0215af5490b891bbc78020b7ed7587a7717b3
push id30418
push userbmo:jyavenard@mozilla.com
push dateMon, 26 Sep 2016 05:26:55 +0000
reviewersgerald
bugs1302573
milestone52.0a1
Bug 1302573: [MSE] P5. Always evict data as soon as we can. r?gerald While never evicting less than 512kB saves CPU cycles, it reduces the chances to evict data when we actually need to and requires currentTime to advance much further. MozReview-Commit-ID: LcQFFtarbbi
dom/media/mediasource/TrackBuffersManager.cpp
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -281,21 +281,16 @@ TrackBuffersManager::EvictData(const Tim
     "buffered=%lldkB, eviction threshold=%ukB, evict=%lldkB canevict=%ukB",
     GetSize() / 1024, EvictionThreshold() / 1024, toEvict / 1024,
     canEvict / 1024);
 
   if (toEvict <= 0) {
     mEvictionState = EvictionState::NO_EVICTION_NEEDED;
     return EvictDataResult::NO_DATA_EVICTED;
   }
-  if (toEvict <= 512*1024) {
-    // Don't bother evicting less than 512KB.
-    mEvictionState = EvictionState::NO_EVICTION_NEEDED;
-    return EvictDataResult::CANT_EVICT;
-  }
 
   EvictDataResult result;
 
   if (mBufferFull && mEvictionState == EvictionState::EVICTION_COMPLETED &&
       canEvict < uint32_t(toEvict)) {
     // Our buffer is currently full. We will make another eviction attempt.
     // However, the current appendBuffer will fail as we can't know ahead of
     // time if the eviction will later succeed.