Prevent division-by-zero in VCMFecMethod.
Clamps frameRate to at least 1.0 to prevent a zero division. BUG=webrtc:5124 R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1642903002 . Cr-Commit-Position: refs/heads/master@{#11421}
This commit is contained in:
parent
46eed76207
commit
5e8351b325
@ -434,6 +434,8 @@ int VCMFecMethod::BitsPerFrame(const VCMProtectionParameters* parameters) {
|
||||
// TODO(mikhal): Update factor following testing.
|
||||
float adjustmentFactor = 1;
|
||||
|
||||
if (frameRate < 1.0f)
|
||||
frameRate = 1.0f;
|
||||
// Average bits per frame (units of kbits)
|
||||
return static_cast<int>(adjustmentFactor * bitRate / frameRate);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user