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);
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);
/* 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);