diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2011-11-03 18:55:24 +0000 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2011-11-07 12:16:37 +0000 |
commit | 9674c5aefab9d061284a8e0e320bdef9c187bebd (patch) | |
tree | 509882192080ff5bbc332122e2fe55630afb326f | |
parent | ab27c0da8ede5a7fff4aade0e96919eb001f98f2 (diff) |
autoconvert: merge caps instead of using union
It's a lot faster, and preserves caps ordering.
https://bugzilla.gnome.org/show_bug.cgi?id=663346
-rw-r--r-- | gst/autoconvert/gstautoconvert.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 0cf7e0874..df094d85b 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -1277,14 +1277,10 @@ gst_auto_convert_sink_getcaps (GstPad * pad) if (element_caps) { if (!gst_caps_is_any (element_caps) && !gst_caps_is_empty (element_caps)) { - GstCaps *tmpcaps = NULL; - - tmpcaps = gst_caps_union (caps, element_caps); - gst_caps_unref (caps); - caps = tmpcaps; - + gst_caps_merge (caps, element_caps); + } else { + gst_caps_unref (element_caps); } - gst_caps_unref (element_caps); } gst_object_unref (element); @@ -1298,11 +1294,7 @@ gst_auto_convert_sink_getcaps (GstPad * pad) if (static_caps && !gst_caps_is_any (static_caps) && !gst_caps_is_empty (static_caps)) { - GstCaps *tmpcaps = NULL; - - tmpcaps = gst_caps_union (caps, static_caps); - gst_caps_unref (caps); - caps = tmpcaps; + gst_caps_merge (caps, static_caps); } } } |