diff --git a/net/aws/src/transcriber/imp.rs b/net/aws/src/transcriber/imp.rs index 4dba1587..7a511271 100644 --- a/net/aws/src/transcriber/imp.rs +++ b/net/aws/src/transcriber/imp.rs @@ -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::().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 { + self.state.lock().unwrap().unsynced_pad.take() + } + fn start_task(&self) -> Result<(), gst::LoggableError> { gst::debug!(CAT, imp = self, "Starting task");