mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 02:26:35 +00:00
fallbacksrc: Unflush downstream pads of the source after shutting down everything
Otherwise the pads might still be flushing on the next try and the source would never recover.
This commit is contained in:
parent
7233d6936c
commit
5788837fb6
1 changed files with 16 additions and 0 deletions
|
@ -2131,6 +2131,17 @@ impl FallbackSrc {
|
|||
);
|
||||
block.pad.remove_probe(block.probe_id);
|
||||
}
|
||||
let stream_sinkpads = [state.audio_stream.as_ref(), state.video_stream.as_ref()]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.map(|s| {
|
||||
if let Some(ref imagefreeze) = s.imagefreeze {
|
||||
imagefreeze.static_pad("sink").unwrap()
|
||||
} else {
|
||||
s.clocksync_queue.static_pad("sink").unwrap()
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
drop(state_guard);
|
||||
|
||||
gst::debug!(CAT, obj: element, "Flushing source");
|
||||
|
@ -2139,6 +2150,11 @@ impl FallbackSrc {
|
|||
gst::debug!(CAT, obj: element, "Shutting down source");
|
||||
let _ = source.set_state(gst::State::Null);
|
||||
|
||||
gst::debug!(CAT, obj: element, "Stop flushing downstream of source");
|
||||
for pad in stream_sinkpads {
|
||||
let _ = pad.send_event(gst::event::FlushStop::builder(true).build());
|
||||
}
|
||||
|
||||
// Sleep for 1s before retrying
|
||||
|
||||
let mut state_guard = src.state.lock();
|
||||
|
|
Loading…
Reference in a new issue