Avoid divide-by-zero and NaN (#1656)

This commit is contained in:
Raja Subramanian
2023-04-26 21:29:25 +05:30
committed by GitHub
parent 5751b8c082
commit 9db46bb866

View File

@@ -349,7 +349,7 @@ func (q *qualityScorer) isLayerMuted() bool {
}
func (q *qualityScorer) getPacketLossWeight(stat *windowStat) float64 {
if stat == nil {
if stat == nil || stat.duration == 0 {
return q.params.PacketLossWeight
}