Commit bf82e750 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵 Committed by Sebastian Dröge

utils/fallbacksrc: Remove custom source elements from internal bin when shutting down

Otherwise we can't add it again later to a new bin when starting up again.
parent fab361d3
Pipeline #206323 passed with stages
in 14 minutes and 53 seconds
......@@ -1109,6 +1109,18 @@ impl FallbackSrc {
state.video_stream = None;
state.audio_stream = None;
if let Source::Element(ref source) = state.configured_source {
// Explicitly remove the source element from the CustomSource so that we can
// later create a new CustomSource and add it again there.
if source.has_as_parent(&state.source) {
let _ = source.set_state(gst::State::Null);
let _ = state
.source
.downcast_ref::<gst::Bin>()
.unwrap()
.remove(source);
}
}
element.remove(&state.source).unwrap();
if let Some(timeout) = state.source_pending_restart_timeout.take() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment