Skip to content

Commit

Permalink
prevent RTPPacketsJitter from being NaN (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Dec 25, 2024
1 parent 5d44205 commit 4d3d6bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,10 @@ func (c *Client) Stats() *ClientStats {
}
}
}
return v / n
if n != 0 {
return v / n
}
return 0
}(),
RTCPPacketsReceived: func() uint64 {
v := uint64(0)
Expand Down
5 changes: 4 additions & 1 deletion server_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,10 @@ func (ss *ServerSession) Stats() *StatsSession {
}
}
}
return v / n
if n != 0 {
return v / n
}
return 0
}(),
RTCPPacketsReceived: func() uint64 {
v := uint64(0)
Expand Down

0 comments on commit 4d3d6bc

Please sign in to comment.