mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
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:
parent
f5df3dea7d
commit
746284f807
1 changed files with 7 additions and 3 deletions
10
gst/gstpad.c
10
gst/gstpad.c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue