summaryrefslogtreecommitdiff
path: root/gst/playback/gstfactorylists.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-09-24 16:05:58 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-07 07:23:20 +0200
commit24b7d2500c85fbb6cb803ba10ada43667ae0729d (patch)
tree4092c341e9eda8c28e5279f9bf132846f40c308b /gst/playback/gstfactorylists.c
parent999483b454a23c0667c41137bfe9df2403f7503d (diff)
factorylist: Use gst_caps_can_intersect() instead of _intersect()
This is faster and results in less allocations.
Diffstat (limited to 'gst/playback/gstfactorylists.c')
-rw-r--r--gst/playback/gstfactorylists.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gst/playback/gstfactorylists.c b/gst/playback/gstfactorylists.c
index 70999275d..df1916f30 100644
--- a/gst/playback/gstfactorylists.c
+++ b/gst/playback/gstfactorylists.c
@@ -240,7 +240,6 @@ gst_factory_list_filter (GValueArray * array, const GstCaps * caps)
/* we only care about the sink templates */
if (templ->direction == GST_PAD_SINK) {
- GstCaps *intersect;
GstCaps *tmpl_caps;
/* try to intersect the caps with the caps of the template */
@@ -248,21 +247,19 @@ gst_factory_list_filter (GValueArray * array, const GstCaps * caps)
/* FIXME, intersect is not the right method, we ideally want to check
* for a subset here */
- intersect = gst_caps_intersect (caps, tmpl_caps);
- gst_caps_unref (tmpl_caps);
/* check if the intersection is empty */
- if (!gst_caps_is_empty (intersect)) {
+ if (gst_caps_can_intersect (caps, tmpl_caps)) {
/* non empty intersection, we can use this element */
GValue resval = { 0, };
g_value_init (&resval, G_TYPE_OBJECT);
g_value_set_object (&resval, factory);
g_value_array_append (result, &resval);
g_value_unset (&resval);
- gst_caps_unref (intersect);
+ gst_caps_unref (tmpl_caps);
break;
}
- gst_caps_unref (intersect);
+ gst_caps_unref (tmpl_caps);
}
}
}