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

Unified Diff: media/filters/video_renderer_algorithm.cc

Issue 1459923003: Fix Bug: Video with Variable Frame Rate plays at incorrect speed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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/video_renderer_algorithm.cc
diff --git a/media/filters/video_renderer_algorithm.cc b/media/filters/video_renderer_algorithm.cc
index 56e30b4a15fb63932ee14d49f5c6ffbc76f91f99..03ca7511d1f2808db63dfe86e880c13c060ac0fc 100644
--- a/media/filters/video_renderer_algorithm.cc
+++ b/media/filters/video_renderer_algorithm.cc
@@ -484,6 +484,7 @@ void VideoRendererAlgorithm::UpdateFrameStatistics() {
// Compute |average_frame_duration_|, a moving average of the last few frames;
// see kMovingAverageSamples for the exact number.
average_frame_duration_ = frame_duration_calculator_.Average();
+ const base::TimeDelta deviation = frame_duration_calculator_.Deviation();
// Update the frame end time for the last frame based on the average.
frame_queue_.back().end_time =
@@ -505,7 +506,8 @@ void VideoRendererAlgorithm::UpdateFrameStatistics() {
return;
const bool cadence_changed = cadence_estimator_.UpdateCadenceEstimate(
- render_interval_, average_frame_duration_, max_acceptable_drift_);
+ render_interval_, average_frame_duration_, deviation,
+ max_acceptable_drift_);
// No need to update cadence if there's been no change; cadence will be set
// as frames are added to the queue.
« no previous file with comments | « media/filters/video_cadence_estimator_unittest.cc ('k') | media/filters/video_renderer_algorithm_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698