mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
utils: Fix caps leaks in gst_element_factory_can_accept_{any,all}_caps_in_direction()
This commit is contained in:
parent
0b6430f6e8
commit
151b7264e8
1 changed files with 12 additions and 4 deletions
|
@ -1286,9 +1286,13 @@ gst_element_factory_can_accept_all_caps_in_direction (GstElementFactory *
|
||||||
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
|
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
|
||||||
|
|
||||||
if (template->direction == direction) {
|
if (template->direction == direction) {
|
||||||
if (gst_caps_is_always_compatible (caps,
|
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
|
||||||
gst_static_caps_get (&template->static_caps)))
|
|
||||||
|
if (gst_caps_is_always_compatible (caps, templcaps)) {
|
||||||
|
gst_caps_unref (templcaps);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
gst_caps_unref (templcaps);
|
||||||
}
|
}
|
||||||
templates = g_list_next (templates);
|
templates = g_list_next (templates);
|
||||||
}
|
}
|
||||||
|
@ -1311,9 +1315,13 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
|
||||||
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
|
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
|
||||||
|
|
||||||
if (template->direction == direction) {
|
if (template->direction == direction) {
|
||||||
if (gst_caps_can_intersect (caps,
|
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
|
||||||
gst_static_caps_get (&template->static_caps)))
|
|
||||||
|
if (gst_caps_can_intersect (caps, templcaps)) {
|
||||||
|
gst_caps_unref (templcaps);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
gst_caps_unref (templcaps);
|
||||||
}
|
}
|
||||||
templates = g_list_next (templates);
|
templates = g_list_next (templates);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue