From 2fee579747e027f7be0d810c73c36cc20679b16d Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 20 Sep 2018 16:28:35 +0200 Subject: [PATCH] element: remove inactive pad g_warning in add_pad The documentation incorrectly used to state that the pads were not automatically activated when added, whereas we actually do that when appropriate. Callers of gst_element_add_pad must not hold the object lock, which implies that they cannot perform the same checks as add_pad in a non-racy manner. This updates the documentation, and removes the g_warning that was output before performing automatic activation. https://bugzilla.gnome.org/show_bug.cgi?id=797181 --- gst/gstelement.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index 2ea49c0..4078fa7 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -640,9 +640,8 @@ gst_element_get_index (GstElement * element) * Adds a pad (link point) to @element. @pad's parent will be set to @element; * see gst_object_set_parent() for refcounting information. * - * Pads are not automatically activated so elements should perform the needed - * steps to activate the pad in case this pad is added in the PAUSED or PLAYING - * state. See gst_pad_set_active() for more information about activating pads. + * Pads are automatically activated when added in the PAUSED or PLAYING + * state. * * The pad and the element should be unlocked when calling this function. * @@ -685,9 +684,6 @@ gst_element_add_pad (GstElement * element, GstPad * pad) /* check for active pads */ if (!active && (GST_STATE (element) > GST_STATE_READY || GST_STATE_NEXT (element) == GST_STATE_PAUSED)) { - g_warning ("adding inactive pad '%s' to running element '%s', you need to " - "use gst_pad_set_active(pad,TRUE) before adding it.", - GST_STR_NULL (pad_name), GST_ELEMENT_NAME (element)); gst_pad_set_active (pad, TRUE); } -- 2.7.4