threadshare/inputselector: Prepare/unprepare any existing sinkpads together with the source pad

We need to reset the sinkpad states when going from/to NULL state.
This commit is contained in:
Sebastian Dröge 2020-04-03 17:03:28 +03:00
parent bbf800f17f
commit a9b43da6cd

View file

@ -434,6 +434,11 @@ impl InputSelector {
self.src_pad.prepare(&InputSelectorPadSrcHandler);
let pads = self.pads.lock().unwrap();
for pad in pads.sink_pads.values() {
pad.prepare(&InputSelectorPadSinkHandler::new());
}
gst_debug!(CAT, obj: element, "Prepared");
Ok(())
@ -445,6 +450,11 @@ impl InputSelector {
self.src_pad.unprepare();
let pads = self.pads.lock().unwrap();
for pad in pads.sink_pads.values() {
pad.unprepare();
}
*state = State::default();
gst_debug!(CAT, obj: element, "Unprepared");