utils: use reffed _get_caps() version
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 30 Apr 2010 09:27:12 +0000 (11:27 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 4 May 2010 09:44:27 +0000 (11:44 +0200)
We don't need to have a writable copy so we can use the _reffed
version instead.

gst/gstutils.c

index e007aca..434bafd 100644 (file)
@@ -1136,7 +1136,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
           gboolean compatible;
 
           /* Now check if the two pads' caps are compatible */
-          temp = gst_pad_get_caps (pad);
+          temp = gst_pad_get_caps_reffed (pad);
           if (caps) {
             intersection = gst_caps_intersect (temp, caps);
             gst_caps_unref (temp);
@@ -1144,7 +1144,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
             intersection = temp;
           }
 
-          temp = gst_pad_get_caps (current);
+          temp = gst_pad_get_caps_reffed (current);
           compatible = gst_caps_can_intersect (temp, intersection);
           gst_caps_unref (temp);
           gst_caps_unref (intersection);
@@ -1190,7 +1190,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
   /* try to create a new one */
   /* requesting is a little crazy, we need a template. Let's create one */
   /* FIXME: why not gst_pad_get_pad_template (pad); */
-  templcaps = gst_pad_get_caps (pad);
+  templcaps = gst_pad_get_caps_reffed (pad);
 
   templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad),
       GST_PAD_DIRECTION (pad), GST_PAD_ALWAYS, templcaps);