mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 10:30:40 +00:00
jitterbuffer: release state lock when requesting pt map
This is similar to what the standard jitterbuffer does, and is necessary to avoid deadlocks with the rtpbin session lock, if the user calls onto any API that requires us to take the state lock at the wrong time (eg setting the latency property, clearing the pt map)
This commit is contained in:
parent
d08268627e
commit
bdfb24abbd
1 changed files with 17 additions and 10 deletions
|
@ -450,16 +450,23 @@ impl SinkHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if state.clock_rate.is_none() {
|
||||
let caps = element
|
||||
.emit("request-pt-map", &[&(pt as u32)])
|
||||
.map_err(|_| gst::FlowError::Error)?
|
||||
.ok_or(gst::FlowError::Error)?
|
||||
.get::<gst::Caps>()
|
||||
.map_err(|_| gst::FlowError::Error)?
|
||||
.ok_or(gst::FlowError::Error)?;
|
||||
self.parse_caps(inner, &mut state, element, &caps, pt)?;
|
||||
}
|
||||
let mut state = {
|
||||
if state.clock_rate.is_none() {
|
||||
drop(state);
|
||||
let caps = element
|
||||
.emit("request-pt-map", &[&(pt as u32)])
|
||||
.map_err(|_| gst::FlowError::Error)?
|
||||
.ok_or(gst::FlowError::Error)?
|
||||
.get::<gst::Caps>()
|
||||
.map_err(|_| gst::FlowError::Error)?
|
||||
.ok_or(gst::FlowError::Error)?;
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
self.parse_caps(inner, &mut state, element, &caps, pt)?;
|
||||
state
|
||||
} else {
|
||||
state
|
||||
}
|
||||
};
|
||||
|
||||
inner.packet_rate_ctx.update(seq, rtptime);
|
||||
|
||||
|
|
Loading…
Reference in a new issue