mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 05:22:30 +00:00
element: link_many should activate pads if needed
gst_element_link_many does some magic and creates ghostpads if needed, but it didn't set the newly created ghostpad to active if needed. This patch fixes it. https://bugzilla.gnome.org/show_bug.cgi?id=626784
This commit is contained in:
parent
41c04c7471
commit
706f0f657b
1 changed files with 10 additions and 0 deletions
|
@ -1450,18 +1450,28 @@ ghost_up (GstElement * e, GstPad * pad)
|
||||||
static gint ghost_pad_index = 0;
|
static gint ghost_pad_index = 0;
|
||||||
GstPad *gpad;
|
GstPad *gpad;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
GstState current;
|
||||||
|
GstState next;
|
||||||
GstObject *parent = GST_OBJECT_PARENT (e);
|
GstObject *parent = GST_OBJECT_PARENT (e);
|
||||||
|
|
||||||
name = g_strdup_printf ("ghost%d", ghost_pad_index++);
|
name = g_strdup_printf ("ghost%d", ghost_pad_index++);
|
||||||
gpad = gst_ghost_pad_new (name, pad);
|
gpad = gst_ghost_pad_new (name, pad);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
|
||||||
|
GST_STATE_LOCK (e);
|
||||||
|
gst_element_get_state (e, ¤t, &next, 0);
|
||||||
|
|
||||||
|
if (current > GST_STATE_READY || next == GST_STATE_PAUSED)
|
||||||
|
gst_pad_set_active (gpad, TRUE);
|
||||||
|
|
||||||
if (!gst_element_add_pad ((GstElement *) parent, gpad)) {
|
if (!gst_element_add_pad ((GstElement *) parent, gpad)) {
|
||||||
g_warning ("Pad named %s already exists in element %s\n",
|
g_warning ("Pad named %s already exists in element %s\n",
|
||||||
GST_OBJECT_NAME (gpad), GST_OBJECT_NAME (parent));
|
GST_OBJECT_NAME (gpad), GST_OBJECT_NAME (parent));
|
||||||
gst_object_unref ((GstObject *) gpad);
|
gst_object_unref ((GstObject *) gpad);
|
||||||
|
GST_STATE_UNLOCK (e);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
GST_STATE_UNLOCK (e);
|
||||||
|
|
||||||
return gpad;
|
return gpad;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue