mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-03 02:03:48 +00:00
rtpbin2: sync: fix race condition
Under some circumstances, the `ssrc` could be added to the `ssrcs` map without the `clock_rate` being defined. When `rtprecv` would check wether the ssrc `has_clock_rate()`, it would return `true` spuriously, which would then cause a panic in `calculate_pts()`. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2337>
This commit is contained in:
parent
594a0152ba
commit
096987a31c
1 changed files with 3 additions and 1 deletions
|
@ -119,7 +119,9 @@ impl Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_clock_rate(&self, ssrc_val: u32) -> bool {
|
pub fn has_clock_rate(&self, ssrc_val: u32) -> bool {
|
||||||
self.ssrcs.contains_key(&ssrc_val)
|
self.ssrcs
|
||||||
|
.get(&ssrc_val)
|
||||||
|
.is_some_and(|ssrc| ssrc.clock_rate.is_some())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn disassociate(&mut self, ssrc_val: u32, cname: &str) {
|
fn disassociate(&mut self, ssrc_val: u32, cname: &str) {
|
||||||
|
|
Loading…
Reference in a new issue