utils: streamproducer: Don't use gst_element_send_event() in another place

It can cause deadlocks thanks to taking the state lock.
This commit is contained in:
Sebastian Dröge 2023-11-10 09:45:09 +02:00
parent 754b6487d4
commit 5ee8ee8545

View file

@ -202,7 +202,9 @@ impl StreamProducer {
if gst_video::UpstreamForceKeyUnitEvent::parse(event).is_ok() {
gst::debug!(CAT, obj: &appsink, "Requesting keyframe");
let _ = appsink.send_event(event.clone());
// Do not use `gst_element_send_event()` as it takes the state lock which may lead to dead locks.
let pad = appsink.static_pad("sink").unwrap();
let _ = pad.push_event(event.clone());
}
gst::PadProbeReturn::Ok