mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 18:16:28 +00:00
rtp/session: guard against a busy wait with no members
If the number of members is 0, then the calculated time to the next rtcp wakup would be 'now' and could result in a busy loop in the rtcp processing. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
This commit is contained in:
parent
84a9f9c61f
commit
2d1f556794
1 changed files with 4 additions and 2 deletions
|
@ -1352,8 +1352,10 @@ impl Session {
|
|||
"members {n}, RTCP bandwidth {rtcp_bw}, average RTCP size {}",
|
||||
self.average_rtcp_size
|
||||
);
|
||||
let t_nanos = (compensation_ns
|
||||
.mul_div_round(self.average_rtcp_size as u64 * n, rtcp_bw.max(1) as u64))
|
||||
let t_nanos = (compensation_ns.mul_div_round(
|
||||
self.average_rtcp_size as u64 * n.max(1),
|
||||
rtcp_bw.max(1) as u64,
|
||||
))
|
||||
.unwrap()
|
||||
.max(min_rtcp_interval.as_nanos() as u64);
|
||||
trace!("deterministic rtcp interval {t_nanos}ns");
|
||||
|
|
Loading…
Reference in a new issue