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

Unified Diff: media/formats/webm/webm_cluster_parser.cc

Issue 220103002: Fix unit test failures with estimated durations and splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix removal of old buffers. Created 6 years, 8 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
« no previous file with comments | « media/filters/source_buffer_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_cluster_parser.cc
diff --git a/media/formats/webm/webm_cluster_parser.cc b/media/formats/webm/webm_cluster_parser.cc
index 5530815caa8a13dffb70578942314fd3a58a5637..5a3adc363d30ba7309a0e82cd49d00c6e7d2a4cb 100644
--- a/media/formats/webm/webm_cluster_parser.cc
+++ b/media/formats/webm/webm_cluster_parser.cc
@@ -532,8 +532,18 @@ bool WebMClusterParser::Track::QueueBuffer(
return false;
}
- estimated_next_frame_duration_ = std::max(duration,
- estimated_next_frame_duration_);
+ // The estimated frame duration is the minimum non-zero duration since the
+ // last initialization segment. The minimum is used to ensure frame durations
+ // aren't overestimated.
+ if (duration > base::TimeDelta()) {
+ if (estimated_next_frame_duration_ == kNoTimestamp()) {
+ estimated_next_frame_duration_ = duration;
+ } else {
+ estimated_next_frame_duration_ =
+ std::min(duration, estimated_next_frame_duration_);
+ }
+ }
+
buffers_.push_back(buffer);
return true;
}
« no previous file with comments | « media/filters/source_buffer_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698