From 4fcd621101a089727b7a66387b2db18fe9c116ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 27 May 2011 14:10:50 +0200 Subject: [PATCH] audioconvert: Use new gst_caps_is_subset_structure() API This prevents one copy of every structure and creating a new caps instance. --- gst/audioconvert/gstaudioconvert.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 26506d2..99ad1a2 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -579,17 +579,12 @@ gst_audio_convert_transform_caps (GstBaseTransform * base, structure = gst_caps_get_structure (caps, j); if (j > 0) { - GstCaps *tmp = gst_caps_new_full (gst_structure_copy (structure), NULL); - /* If the new structure is a subset of the already existing transformed * caps we can safely skip it because we would transform it to the * same caps again. */ - if (gst_caps_is_subset (tmp, ret)) { - gst_caps_unref (tmp); + if (gst_caps_is_subset_structure (ret, structure)) continue; - } - gst_caps_unref (tmp); } structure_name = gst_structure_get_name (structure); -- 2.7.4