discoverer: Uniquely name elements

Helps identifying actual queue/fakesink usage. There seems to be
a race in discoverer, this should help track it down.
This commit is contained in:
Edward Hervey 2017-11-02 07:18:17 +01:00
parent 33dfed5af8
commit 39ba6427f1

View file

@ -608,6 +608,8 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
PrivateStream *ps; PrivateStream *ps;
GstPad *sinkpad = NULL; GstPad *sinkpad = NULL;
GstCaps *caps; GstCaps *caps;
gchar *padname;
gchar *tmpname;
GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
@ -615,8 +617,14 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
ps->dc = dc; ps->dc = dc;
ps->pad = pad; ps->pad = pad;
ps->queue = gst_element_factory_make ("queue", NULL); padname = gst_pad_get_name (pad);
ps->sink = gst_element_factory_make ("fakesink", NULL); tmpname = g_strdup_printf ("discoverer-queue-%s", padname);
ps->queue = gst_element_factory_make ("queue", tmpname);
g_free (tmpname);
tmpname = g_strdup_printf ("discoverer-sink-%s", padname);
ps->sink = gst_element_factory_make ("fakesink", tmpname);
g_free (tmpname);
g_free (padname);
if (G_UNLIKELY (ps->queue == NULL || ps->sink == NULL)) if (G_UNLIKELY (ps->queue == NULL || ps->sink == NULL))
goto error; goto error;