Commit 5470f6df authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by Julian Bouzas

latency: Dot not override already stored events

First, the event would be leaved, but also when an element takes
several buffers before producing one, we want the reported latency to be
the aggregation, so the distance from the oldest buffer.
parent bdb75a14
......@@ -300,8 +300,9 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
/* store event so that we can calculate latency when the buffer that
* follows has been processed */
g_object_set_qdata ((GObject *) pad, latency_probe_id,
gst_event_ref (ev));
if (!g_object_get_qdata ((GObject *) pad, latency_probe_id))
g_object_set_qdata ((GObject *) pad, latency_probe_id,
gst_event_ref (ev));
}
}
......@@ -314,8 +315,9 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
if (!g_str_equal (g_value_get_string (value), pad_name)) {
GST_DEBUG ("%s: Storing sub-latency event", pad_name);
g_object_set_qdata ((GObject *) pad, sub_latency_probe_id,
gst_event_ref (ev));
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);
......
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