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

Unified Diff: media/filters/video_cadence_estimator.cc

Issue 2827123007: Ignore negative cadence values. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_cadence_estimator.cc
diff --git a/media/filters/video_cadence_estimator.cc b/media/filters/video_cadence_estimator.cc
index 7548b8277051a0d9e9b659aeb1ca75947d1d2ce7..ee8916e0c048001056d5089f0971e83e1b6b0b2a 100644
--- a/media/filters/video_cadence_estimator.cc
+++ b/media/filters/video_cadence_estimator.cc
@@ -189,6 +189,8 @@ VideoCadenceEstimator::Cadence VideoCadenceEstimator::CalculateCadence(
// within minimum_time_until_max_drift.
if (max_acceptable_drift >= minimum_time_until_max_drift_) {
int cadence_value = round(perfect_cadence);
+ if (cadence_value < 0)
+ return Cadence();
if (cadence_value == 0)
cadence_value = 1;
Cadence result = ConstructCadence(cadence_value, 1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698