From bbe88b190bbbbcf0c169b2e3909f5fc9c48b7caf Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 11 Nov 2016 14:31:03 +1100 Subject: [PATCH] autodetect: bring the element state down after success Otherwise some messages that are emitted by the element on NULL->READY will not reach the application. https://bugzilla.gnome.org/show_bug.cgi?id=764947 --- gst/autodetect/gstautodetect.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/autodetect/gstautodetect.c b/gst/autodetect/gstautodetect.c index a256e52..3e30241 100644 --- a/gst/autodetect/gstautodetect.c +++ b/gst/autodetect/gstautodetect.c @@ -310,6 +310,7 @@ gst_auto_detect_find_best (GstAutoDetect * self) ret = gst_element_set_state (el, GST_STATE_READY); if (ret == GST_STATE_CHANGE_SUCCESS) { GST_DEBUG_OBJECT (self, "This worked!"); + gst_element_set_state (el, GST_STATE_NULL); choice = el; break; } @@ -379,14 +380,13 @@ gst_auto_detect_detect (GstAutoDetect * self) } self->kid = kid; - /* Ensure the child is brought up to the right state to match the parent. - * Although it's currently always in READY and we're always doing NULL->READY. - */ - if (GST_STATE (self->kid) < GST_STATE (self)) - gst_element_set_state (self->kid, GST_STATE (self)); gst_bin_add (GST_BIN (self), kid); + /* Ensure the child is brought up to the right state to match the parent. */ + if (GST_STATE (self->kid) < GST_STATE (self)) + gst_element_set_state (self->kid, GST_STATE (self)); + /* attach ghost pad */ GST_DEBUG_OBJECT (self, "Re-assigning ghostpad"); if (!gst_auto_detect_attach_ghost_pad (self)) -- 2.7.4