Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(899)

Unified Diff: media/filters/source_buffer_range.cc

Issue 1008463002: Fix MSE GC, make it less aggressive, more spec-compliant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added new test case: GarbageCollection_SaveDataAtPlaybackPosition Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/source_buffer_range.cc
diff --git a/media/filters/source_buffer_range.cc b/media/filters/source_buffer_range.cc
index 4fad27dbceff01824060ffe30e2fb0b4f0ec14aa..8245a06a0328b5a68f187616f5ad4bb463ec9d25 100644
--- a/media/filters/source_buffer_range.cc
+++ b/media/filters/source_buffer_range.cc
@@ -341,6 +341,16 @@ int SourceBufferRange::GetRemovalGOP(
return bytes_removed;
}
+bool SourceBufferRange::FirstGOPEarlierThanMediaTime(
+ DecodeTimestamp media_time) const {
+ if (keyframe_map_.size() == 1u)
+ return (GetEndTimestamp() < media_time);
+
+ KeyframeMap::const_iterator second_gop = keyframe_map_.begin();
+ ++second_gop;
+ return second_gop->first <= media_time;
+}
+
bool SourceBufferRange::FirstGOPContainsNextBufferPosition() const {
if (!HasNextBufferPosition())
return false;

Powered by Google App Engine
This is Rietveld 408576698