From 6378337a0ee7a539220fa909c8af30b077e71f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 31 Jul 2020 12:03:46 +0300 Subject: [PATCH] sendrecv/Rust: Only set pipeline to Playing after connecting to the signals Might miss some signal emissions otherwise, especially the on-negotiation-needed signal. Part-of: --- webrtc/sendrecv/gst-rust/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webrtc/sendrecv/gst-rust/src/main.rs b/webrtc/sendrecv/gst-rust/src/main.rs index 961b97d382..904b0727f4 100644 --- a/webrtc/sendrecv/gst-rust/src/main.rs +++ b/webrtc/sendrecv/gst-rust/src/main.rs @@ -142,13 +142,6 @@ impl App { // Channel for outgoing WebSocket messages from other threads let (send_ws_msg_tx, send_ws_msg_rx) = mpsc::unbounded::(); - // Asynchronously set the pipeline to Playing - pipeline.call_async(|pipeline| { - pipeline - .set_state(gst::State::Playing) - .expect("Couldn't set pipeline to Playing"); - }); - let app = App(Arc::new(AppInner { args, pipeline, @@ -228,6 +221,13 @@ impl App { } }); + // Asynchronously set the pipeline to Playing + app.pipeline.call_async(|pipeline| { + pipeline + .set_state(gst::State::Playing) + .expect("Couldn't set pipeline to Playing"); + }); + Ok((app, send_gst_msg_rx, send_ws_msg_rx)) }