From 7875ee11a570b16f502579485e21964c69ddba0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 4 Nov 2011 10:37:12 +0100 Subject: [PATCH] subtitleoverlay: Use gst_caps_merge() instead of gst_caps_union() This keeps the caps order and is more efficient. --- gst/playback/gstsubtitleoverlay.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index b3b53c7..49d790b 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -298,26 +298,16 @@ _factory_filter (GstPluginFeature * feature, GstCaps ** subcaps) templ_caps = _get_sub_caps (factory); if (is_renderer && have_video_sink && templ_caps) { - GstCaps *tmp; - GST_DEBUG ("Found renderer element %s (%s) with caps %" GST_PTR_FORMAT, gst_element_factory_get_longname (factory), gst_plugin_feature_get_name (feature), templ_caps); - tmp = gst_caps_union (*subcaps, templ_caps); - gst_caps_unref (templ_caps); - gst_caps_replace (subcaps, tmp); - gst_caps_unref (tmp); + gst_caps_merge (*subcaps, templ_caps); return TRUE; } else if (!is_renderer && !have_video_sink && templ_caps) { - GstCaps *tmp; - GST_DEBUG ("Found parser element %s (%s) with caps %" GST_PTR_FORMAT, gst_element_factory_get_longname (factory), gst_plugin_feature_get_name (feature), templ_caps); - tmp = gst_caps_union (*subcaps, templ_caps); - gst_caps_unref (templ_caps); - gst_caps_replace (subcaps, tmp); - gst_caps_unref (tmp); + gst_caps_merge (*subcaps, templ_caps); return TRUE; } else { if (templ_caps) -- 2.7.4