value: Consider NULL caps in array a fixed value

There's no requirement for caps in arrays to be non-NULL and NULL is clearly a
fixed, single value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9522>
This commit is contained in:
Sebastian Dröge 2025-08-09 17:10:32 +03:00 committed by GStreamer Marge Bot
parent c1d0fb0165
commit 58a48d92bb

View File

@ -7085,7 +7085,8 @@ gst_value_is_fixed (const GValue * value)
return gst_structure_foreach_id_str (gst_value_get_structure (value),
structure_field_is_fixed, NULL);
} else if (type == GST_TYPE_CAPS) {
return gst_caps_is_fixed (gst_value_get_caps (value));
const GstCaps *caps = gst_value_get_caps (value);
return !caps || gst_caps_is_fixed (caps);
}
return gst_type_is_fixed (type);
}
@ -7176,10 +7177,13 @@ gst_value_fixate (GValue * dest, const GValue * src)
return TRUE;
} else if (G_VALUE_TYPE (src) == GST_TYPE_CAPS) {
g_value_init (dest, GST_TYPE_CAPS);
GstCaps *caps = gst_caps_copy (gst_value_get_caps (src));
caps = gst_caps_fixate (caps);
GstCaps *caps = (GstCaps *) gst_value_get_caps (src);
if (caps) {
caps = gst_caps_fixate (gst_caps_copy (caps));
}
gst_value_set_caps (dest, caps);
gst_caps_unref (caps);
if (caps)
gst_caps_unref (caps);
return TRUE;
} else {
return FALSE;