query: do not return a ref from parse_accept_caps
authorRené Stadler <rene.stadler@collabora.co.uk>
Sat, 12 Nov 2011 00:51:11 +0000 (01:51 +0100)
committerRené Stadler <rene.stadler@collabora.co.uk>
Sat, 12 Nov 2011 00:53:13 +0000 (01:53 +0100)
Makes this exactly like gst_event_parse_caps. This is what current code
expects, so it fixes some leaks.

gst/gstquery.c

index b9c828a..e08e6a5 100644 (file)
@@ -2028,6 +2028,14 @@ gst_query_new_accept_caps (GstCaps * caps)
   return query;
 }
 
+/**
+ * gst_query_parse_accept_caps:
+ * @query: The query to parse
+ * @caps: (out): A pointer to the caps
+ *
+ * Get the caps from @query. The caps remains valid as long as @query remains
+ * valid.
+ */
 void
 gst_query_parse_accept_caps (GstQuery * query, GstCaps ** caps)
 {
@@ -2036,7 +2044,8 @@ gst_query_parse_accept_caps (GstQuery * query, GstCaps ** caps)
   g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS);
 
   structure = GST_QUERY_STRUCTURE (query);
-  gst_structure_id_get (structure, GST_QUARK (CAPS), GST_TYPE_CAPS, caps, NULL);
+  *caps = g_value_get_boxed (gst_structure_id_get_value (structure,
+          GST_QUARK (CAPS)));
 }
 
 void