latency: Dot not override already stored events
[platform/upstream/gstreamer.git] / gst / gstparamspecs.c
index 8882062..7de51d7 100644 (file)
@@ -138,7 +138,7 @@ gst_param_spec_fraction_get_type (void)
       _gst_param_fraction_validate,     /* value_validate    */
       _gst_param_fraction_values_cmp,   /* values_cmp        */
     };
-    pspec_info.value_type = GST_TYPE_FRACTION;
+    pspec_info.value_type = gst_fraction_get_type ();
     type = g_param_type_register_static ("GstParamFraction", &pspec_info);
     g_once_init_leave (&gst_faction_type, type);
   }
@@ -164,7 +164,7 @@ gst_param_spec_fraction_get_type (void)
  * used in connection with g_object_class_install_property() in a GObjects's
  * instance_init function.
  *
- * Returns: (transfer full): a newly created parameter specification
+ * Returns: (transfer full) (nullable): a newly created parameter specification
  */
 GParamSpec *
 gst_param_spec_fraction (const gchar * name, const gchar * nick,
@@ -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
@@ -339,6 +341,8 @@ gst_param_spec_array_get_type (void)
  * GObjects's instance_init function.
  *
  * Returns: (transfer full): a newly created parameter specification
+ *
+ * Since: 1.14
  */
 
 GParamSpec *
@@ -348,8 +352,8 @@ gst_param_spec_array (const gchar * name,
 {
   GstParamSpecArray *aspec;
 
-  if (element_spec)
-    g_return_val_if_fail (G_IS_PARAM_SPEC (element_spec), NULL);
+  g_return_val_if_fail (element_spec == NULL
+      || G_IS_PARAM_SPEC (element_spec), NULL);
 
   aspec = g_param_spec_internal (GST_TYPE_PARAM_ARRAY_LIST,
       name, nick, blurb, flags);