Remove zero-divide in VCMContentMetricsProcessing.

Protects against zero-framerate in UpdateFrameRate.

BUG=webrtc:5124
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1636943003 .

Cr-Commit-Position: refs/heads/master@{#11382}
This commit is contained in:
Peter Boström
2016-01-26 16:18:48 +01:00
parent 83277131b1
commit 59b2d3ebe7

View File

@ -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);