From: Stefan Kost Date: Thu, 6 May 2010 06:17:33 +0000 (+0300) Subject: videoscale: use can_intersect to avoid a caps copy X-Git-Tag: RELEASE-0.10.30~223 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4967d4e3fd0ac94d635d41beb3b6e77b392a71e0;p=platform%2Fupstream%2Fgst-plugins-base.git videoscale: use can_intersect to avoid a caps copy --- diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 00479e1..1844e43 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -356,16 +356,13 @@ static int gst_video_scale_get_format (GstCaps * caps) { gint i; - GstCaps *icaps, *scaps; + GstCaps *scaps; for (i = 0; i < G_N_ELEMENTS (gst_video_scale_format_caps); i++) { scaps = gst_static_caps_get (&gst_video_scale_format_caps[i]); - icaps = gst_caps_intersect (caps, scaps); - if (!gst_caps_is_empty (icaps)) { - gst_caps_unref (icaps); + if (gst_caps_can_intersect (caps, scaps)) { return i; } - gst_caps_unref (icaps); } return -1;