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

Unified Diff: webrtc/modules/video_coding/content_metrics_processing.cc

Issue 1636943003: Remove zero-divide in VCMContentMetricsProcessing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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: webrtc/modules/video_coding/content_metrics_processing.cc
diff --git a/webrtc/modules/video_coding/content_metrics_processing.cc b/webrtc/modules/video_coding/content_metrics_processing.cc
index 0c3a6dbc6c562f655168c73e2766ab0da688a7f8..b2586fce3fb42b507cd4cd5282f1a7733eb6526e 100644
--- a/webrtc/modules/video_coding/content_metrics_processing.cc
+++ b/webrtc/modules/video_coding/content_metrics_processing.cc
@@ -44,6 +44,8 @@ int VCMContentMetricsProcessing::Reset() {
}
void VCMContentMetricsProcessing::UpdateFrameRate(uint32_t frameRate) {
+ if (frameRate == 0)
+ frameRate = 1;
// Update factor for recursive averaging.
recursive_avg_factor_ = static_cast<float>(1000.0f) /
static_cast<float>(frameRate * kQmMinIntervalMs);
« 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