From 0f0a62f316aff3a135ca4bcfe98964f1d053be73 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 19 Apr 2010 20:40:56 +0200 Subject: [PATCH] basetransform: Retain caps order when getting caps If the element gave us caps in a specific order, let's retain that by intersecting against the template but retaining the order given by the element. https://bugzilla.gnome.org/show_bug.cgi?id=617045 --- libs/gst/base/gstbasetransform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index db4f963109..76fec60465 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -686,7 +686,8 @@ gst_base_transform_getcaps (GstPad * pad) /* and filter against the template of this pad */ templ = gst_pad_get_pad_template_caps (pad); GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ); - temp = gst_caps_intersect (caps, templ); + /* We keep the caps sorted like the returned caps */ + temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp); gst_caps_unref (caps); /* this is what we can do */