From 5f6eacd1e3029cc2c925c7b43744ae903db71976 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 13 Sep 2024 15:12:49 +0200 Subject: Set GST pipeline to NULL state earlier in teardown --- src/GSTInput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GSTInput.cpp b/src/GSTInput.cpp index 6c437d7..af27db1 100644 --- a/src/GSTInput.cpp +++ b/src/GSTInput.cpp @@ -300,6 +300,10 @@ void GSTInput::process() GSTInput::~GSTInput() { + if (m_gst_data.pipeline) { + gst_element_set_state(m_gst_data.pipeline, GST_STATE_NULL); + } + m_running = false; // Ensures push() doesn't get blocked @@ -314,7 +318,6 @@ GSTInput::~GSTInput() } if (m_gst_data.pipeline) { - gst_element_set_state(m_gst_data.pipeline, GST_STATE_NULL); gst_object_unref(m_gst_data.pipeline); } } -- cgit v1.2.3