mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 18:14:15 +00:00
paramspec: Fix array validation logic
A paramspec validation should modify the content to match what the spec requires and return TURE if a modification happened. This previous implementation would only fix the first element of the array and return. It was also return TRUE for empty array, while no modification was needed. https://bugzilla.gnome.org/show_bug.cgi?id=780111
This commit is contained in:
parent
3b9ff1245b
commit
1a65d5b252
1 changed files with 6 additions and 4 deletions
|
@ -233,6 +233,7 @@ static gboolean
|
|||
_gst_param_array_validate (GParamSpec * pspec, GValue * value)
|
||||
{
|
||||
GstParamSpecArray *aspec = GST_PARAM_SPEC_ARRAY_LIST (pspec);
|
||||
gboolean ret = FALSE;
|
||||
|
||||
/* ensure array values validity against a present element spec */
|
||||
if (aspec->element_spec) {
|
||||
|
@ -249,15 +250,16 @@ _gst_param_array_validate (GParamSpec * pspec, GValue * value)
|
|||
g_value_unset (element);
|
||||
g_value_init (element, G_PARAM_SPEC_VALUE_TYPE (element_spec));
|
||||
g_param_value_set_default (element_spec, element);
|
||||
return FALSE;
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
/* validate array value against element_spec */
|
||||
if (!g_param_value_validate (element_spec, element))
|
||||
return FALSE;
|
||||
if (g_param_value_validate (element_spec, element))
|
||||
ret = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gint
|
||||
|
|
Loading…
Reference in a new issue