gstreamer: parse: Don't assume that child proxy child objects are GstObjects

The name is already passed via the signal parameters so it doesn't have
to be retrieved again via GstObject API, which would crash on other
GObjects. Child proxy child objects can be any kind of GObject and the
code here otherwise handles this correctly already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6938>
This commit is contained in:
Sebastian Dröge 2024-05-28 13:17:39 +03:00 committed by GStreamer Marge Bot
parent 79312357a6
commit 529f2472b3

View file

@ -451,8 +451,7 @@ static void gst_parse_new_child(GstChildProxy *child_proxy, GObject *object,
goto error;
g_object_set_property (target, pspec->name, &v);
} else {
const gchar *obj_name = GST_OBJECT_NAME(object);
gint len = strlen (obj_name);
gint len = strlen (name);
/*
* We've been notified that a new child has beed added, but the
@ -472,7 +471,7 @@ static void gst_parse_new_child(GstChildProxy *child_proxy, GObject *object,
*/
/* Cases 1,2: The child just added corresponds to this delayed set */
if ((strlen (set->name) > (len+2)) && !strncmp (set->name, obj_name, len)
if ((strlen (set->name) > (len+2)) && !strncmp (set->name, name, len)
&& !strncmp (&set->name[len], "::", 2)) {
gchar *children = NULL;
gchar *prop = NULL;