fallbackswitch: example deadlocks with immediate-fallback
diff --git c/utils/fallbackswitch/examples/gtk_fallbackswitch.rs i/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
index 50589c45..0aa04890 100644
--- c/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
+++ i/utils/fallbackswitch/examples/gtk_fallbackswitch.rs
@@ -33,6 +33,7 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element, gtk::Widget) {
let fallbackswitch = gst::ElementFactory::make("fallbackswitch", None).unwrap();
fallbackswitch.set_property("timeout", gst::ClockTime::SECOND);
+ fallbackswitch.set_property("immediate-fallback", true);
let decodebin = gst::ElementFactory::make("decodebin", None).unwrap();
let videoconvert = gst::ElementFactory::make("videoconvert", None).unwrap();
This makes the example pipeline deadlock during preroll. Three threads are involved.
- The fallback stream pushes through the switch and blocks on preroll in the sink while holding the src pad stream lock.
- The main stream pushes into the switch, becomes active and tries to obtain the src pad stream lock while holding the state lock.
- The pipeline's async state change attempts to recalculate latency, resulting in a latency query that tries to obtain the state lock.
- The latency calculation never completes, thus preroll never completes.
Edited by Jan Alexander Steffens