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
--- 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.