tracer/latency: clear qdata
authorStefan Sauer <ensonic@users.sf.net>
Wed, 7 Dec 2016 20:53:49 +0000 (21:53 +0100)
committerStefan Sauer <ensonic@users.sf.net>
Wed, 7 Dec 2016 20:53:49 +0000 (21:53 +0100)
When reading the qdata, clear it to avoid it being read and unreffed again.
Fixes #774332

plugins/tracers/gstlatency.c

index af5746b..3335f63 100644 (file)
@@ -149,8 +149,11 @@ calculate_latency (GstElement * parent, GstPad * pad, guint64 ts)
       GST_OBJECT_FLAG_IS_SET (parent, GST_ELEMENT_FLAG_SINK)) {
     GstEvent *ev = g_object_get_qdata ((GObject *) pad, latency_probe_id);
 
-    log_latency (gst_event_get_structure (ev), pad, ts);
-    gst_event_unref (ev);
+    if (ev) {
+      g_object_set_qdata ((GObject *) pad, latency_probe_id, NULL);
+      log_latency (gst_event_get_structure (ev), pad, ts);
+      gst_event_unref (ev);
+    }
   }
 }