+2008-07-22 Thijs Vermeir <thijsvermeir@gmail.com>
+
+ * gst/gstcaps.c:
+ Allow passing of NULL to gst_caps_union
+
2008-07-21 Thijs Vermeir <thijsvermeir@gmail.com>
* gst/gstghostpad.c:
* Creates a new #GstCaps that contains all the formats that are in
* either @caps1 and @caps2.
*
+ * This function deals correctly with passing NULL for any of the caps.
+ *
* Returns: the new #GstCaps
*/
GstCaps *
GstCaps *dest1;
GstCaps *dest2;
+ if (!caps1 && !caps2)
+ return gst_caps_new_empty ();
+
+ if (!caps1 || gst_caps_is_empty (caps1))
+ return gst_caps_copy (caps2);
+
+ if (!caps2 || gst_caps_is_empty (caps2))
+ return gst_caps_copy (caps1);
+
if (gst_caps_is_any (caps1) || gst_caps_is_any (caps2))
return gst_caps_new_any ();