pad: make _fixate_caps() also truncate when needed

The default gst_pad_fixate_caps() previously would only fixate each individual
struct. In case there are multiple structs, the resulting caps would still not
be fixed. In the spirit of how individual structs are fixated, this patch
changes gst_pad_fixate_caps() to remove all but the first struct.

Fixes #595886
This commit is contained in:
Rob Clark 2009-09-09 15:37:11 -05:00 committed by Wim Taymans
parent f5df3dea7d
commit 746284f807

View file

@ -2404,7 +2404,7 @@ void
gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
{
GstPadFixateCapsFunction fixatefunc;
guint n, len;
guint len;
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (caps != NULL);
@ -2419,11 +2419,15 @@ gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
/* default fixation */
len = gst_caps_get_size (caps);
for (n = 0; n < len; n++) {
GstStructure *s = gst_caps_get_structure (caps, n);
if (len > 0) {
GstStructure *s = gst_caps_get_structure (caps, 0);
gst_structure_foreach (s, gst_pad_default_fixate, s);
}
if (len > 1) {
gst_caps_truncate (caps);
}
}
/* Default accept caps implementation just checks against