fallbackswitch: Flush and deactivate pads before releasing them

This commit is contained in:
Sebastian Dröge 2022-08-23 16:28:37 +03:00
parent b6ebad2761
commit 1f7126a8a1

View file

@ -1418,6 +1418,12 @@ impl ElementImpl for FallbackSwitch {
}
fn release_pad(&self, element: &Self::Type, pad: &gst::Pad) {
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
let mut pad_state = pad.imp().state.lock();
pad_state.flush_start();
drop(pad_state);
let _ = pad.set_active(false);
element.remove_pad(pad).unwrap();
element.child_removed(pad, &pad.name());