awstranscriber: release matching unsynced pad along request pads

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1930>
This commit is contained in:
Mathieu Duponchelle 2024-11-20 17:08:30 +01:00 committed by GStreamer Marge Bot
parent 4720b575b6
commit c57b74e269

View file

@ -1130,6 +1130,13 @@ impl ElementImpl for Transcriber {
self.obj().remove_pad(pad).unwrap();
self.state.lock().unwrap().srcpads.remove(pad);
let translate_srcpad = pad.downcast_ref::<super::TranslateSrcPad>().unwrap();
if let Some(unsynced_pad) = translate_srcpad.imp().take_unsynced_pad() {
unsynced_pad.set_active(false).unwrap();
self.obj().remove_pad(&unsynced_pad).unwrap();
}
self.obj().child_removed(pad, &pad.name());
let _ = self
.obj()
@ -1756,6 +1763,10 @@ impl TranslateSrcPad {
self.state.lock().unwrap().unsynced_pad = Some(pad.clone());
}
fn take_unsynced_pad(&self) -> Option<gst::Pad> {
self.state.lock().unwrap().unsynced_pad.take()
}
fn start_task(&self) -> Result<(), gst::LoggableError> {
gst::debug!(CAT, imp = self, "Starting task");