mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-20 02:21:00 +00:00
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.
This commit is contained in:
parent
fab361d32d
commit
bf82e750f4
1 changed files with 12 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue