Commit 308f5051 authored by Julian Bouzas's avatar Julian Bouzas

tracer: latency: Fix bug when storing latency probe event

The pad name sotred in the latency event has no longer the name of the element,
so we have to get the element Id, element name and pad name values from the data
structure and compare all 3 values.
parent e0c9d4f8
......@@ -405,19 +405,32 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
if (gst_structure_get_name_id (data) == sub_latency_probe_id) {
const GValue *value;
gchar *pad_name = g_strdup_printf ("%s_%s",
GST_DEBUG_PAD_NAME (peer_pad));
gchar *element_id = g_strdup_printf ("%p", peer_parent);
gchar *element_name = gst_element_get_name (peer_parent);
gchar *pad_name = gst_pad_get_name (peer_pad);
const gchar *value_element_id, *value_element_name, *value_pad_name;
/* Get the element id, element name and pad name from data */
value = gst_structure_id_get_value (data, latency_probe_element_id);
value_element_id = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_element);
value_element_name = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_pad);
value_pad_name = g_value_get_string (value);
if (!g_str_equal (value_element_id, element_id) ||
!g_str_equal (value_element_name, element_name) ||
!g_str_equal (value_pad_name, pad_name)) {
GST_DEBUG ("%s_%s: Storing latency event", GST_DEBUG_PAD_NAME (pad));
if (!g_str_equal (g_value_get_string (value), pad_name)) {
GST_DEBUG ("%s: Storing sub-latency event", pad_name);
if (!g_object_get_qdata ((GObject *) pad, sub_latency_probe_id))
g_object_set_qdata ((GObject *) pad, sub_latency_probe_id,
gst_event_ref (ev));
g_free (pad_name);
g_free (element_name);
g_free (element_id);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment