From 1bab0ef2aae77eea17d592af1eee03bafaffda0d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 30 Jan 2023 23:49:25 -0300 Subject: [PATCH] bin: Do not deactivate pad in NULL_TO_READY Since https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b76d3365497ded1fd4d536f0da2b9702f614b806 pads are deactivated when going to READY but in `uridecodebin(3)`, the sources source pads are activated while in NULL state (when PULL mode is supported), meaning that we are ending up deactivating those pads in NULL_TO_READY, breaking the pipeline. The intent of the commit mentioned above is to ensure that the pads are deactivated either in PAUSED_TO_READY or READY_TO_READY, so it should be safe to avoid deactivating in NULL_TO_READY. Part-of: --- subprojects/gstreamer/gst/gstbin.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subprojects/gstreamer/gst/gstbin.c b/subprojects/gstreamer/gst/gstbin.c index ed23c2633b..19b9d9274f 100644 --- a/subprojects/gstreamer/gst/gstbin.c +++ b/subprojects/gstreamer/gst/gstbin.c @@ -2876,10 +2876,13 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition) GST_DEBUG_OBJECT (element, "clearing all cached messages"); bin_remove_messages (bin, NULL, GST_MESSAGE_ANY); GST_OBJECT_UNLOCK (bin); - /* We might not have reached PAUSED yet due to async errors, - * make sure to always deactivate the pads nonetheless */ - if (!(gst_bin_src_pads_activate (bin, FALSE))) - goto activate_failure; + /* Pads can be activated in PULL mode before in NULL state */ + if (current != GST_STATE_NULL) { + /* We might not have reached PAUSED yet due to async errors, + * make sure to always deactivate the pads nonetheless */ + if (!gst_bin_src_pads_activate (bin, FALSE)) + goto activate_failure; + } break; case GST_STATE_NULL: /* Clear message list on next NULL */