utils: Fix caps leaks in gst_element_factory_can_accept_{any,all}_caps_in_direction()

This commit is contained in:
Sebastian Dröge 2011-04-14 08:59:14 +02:00
parent 0b6430f6e8
commit 151b7264e8

View file

@ -1286,9 +1286,13 @@ gst_element_factory_can_accept_all_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_is_always_compatible (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_is_always_compatible (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}
@ -1311,9 +1315,13 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_can_intersect (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_can_intersect (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}