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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user