event: don't ref the caps
authorWim Taymans <wim.taymans@collabora.co.uk>
Sun, 8 May 2011 10:38:05 +0000 (12:38 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Sun, 8 May 2011 10:38:05 +0000 (12:38 +0200)
Use a different way of getting the caps from the caps event so that no
refcounting happens.

gst/gstevent.c

index ca705d1..31bff21 100644 (file)
@@ -514,11 +514,16 @@ gst_event_new_caps (GstCaps * caps)
 void
 gst_event_parse_caps (GstEvent * event, GstCaps ** caps)
 {
+  GstStructure *structure;
+
   g_return_if_fail (GST_IS_EVENT (event));
   g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_CAPS);
 
-  gst_structure_id_get (event->structure,
-      GST_QUARK (CAPS), GST_TYPE_CAPS, caps, NULL);
+  structure = event->structure;
+  if (G_LIKELY (caps))
+    *caps =
+        g_value_get_boxed (gst_structure_id_get_value (structure,
+            GST_QUARK (CAPS)));
 }
 
 /**