From 191b1644d6866cb0220b6668151845d9631bf25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 16 Mar 2022 10:25:56 +0200 Subject: [PATCH] fallbacksrc: Flush source before restarting on errors It might still be blocked downstream for a while, e.g. in the clocksync. Flushing does not cause any problems as fallbackswitch is not going to forward it and will only unblock everything up to there. --- utils/fallbackswitch/src/fallbacksrc/imp.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index b4e68190..88e76012 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -2108,6 +2108,9 @@ impl FallbackSrc { } drop(state_guard); + gst_debug!(CAT, obj: element, "Flushing source"); + let _ = source.send_event(gst::event::FlushStart::builder().build()); + gst_debug!(CAT, obj: element, "Shutting down source"); let _ = source.set_state(gst::State::Null);