query: Only allow fixed caps in the accept-caps query
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 21 Mar 2012 08:00:45 +0000 (09:00 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 21 Mar 2012 08:00:45 +0000 (09:00 +0100)
gst/gstquery.c

index 77f6c62..c1d8165 100644 (file)
@@ -2122,7 +2122,7 @@ gst_query_has_scheduling_mode (GstQuery * query, GstPadMode mode)
 
 /**
  * gst_query_new_accept_caps:
- * @caps: a #GstCaps
+ * @caps: a fixed #GstCaps
  *
  * Constructs a new query object for querying if @caps are accepted.
  *
@@ -2136,6 +2136,8 @@ gst_query_new_accept_caps (GstCaps * caps)
   GstQuery *query;
   GstStructure *structure;
 
+  g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
+
   structure = gst_structure_new_id (GST_QUARK (QUERY_ACCEPT_CAPS),
       GST_QUARK (CAPS), GST_TYPE_CAPS, caps,
       GST_QUARK (RESULT), G_TYPE_BOOLEAN, FALSE, NULL);