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
_gst_param_array_validate (GParamSpec * pspec, GValue * value)
{
GstParamSpecArray *aspec = GST_PARAM_SPEC_ARRAY_LIST (pspec);
_gst_param_array_validate (GParamSpec * pspec, GValue * value)
{
GstParamSpecArray *aspec = GST_PARAM_SPEC_ARRAY_LIST (pspec);
/* ensure array values validity against a present element spec */
if (aspec->element_spec) {
/* ensure array values validity against a present element spec */
if (aspec->element_spec) {
g_value_unset (element);
g_value_init (element, G_PARAM_SPEC_VALUE_TYPE (element_spec));
g_param_value_set_default (element_spec, element);
g_value_unset (element);
g_value_init (element, G_PARAM_SPEC_VALUE_TYPE (element_spec));
g_param_value_set_default (element_spec, element);
/* validate array value against element_spec */
/* 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;