paramspecs: Use gst_value_array_get_type() for GstParamSpecArray type
authorJan Schmidt <jan@centricular.com>
Fri, 24 Mar 2017 06:53:31 +0000 (17:53 +1100)
committerJan Schmidt <jan@centricular.com>
Fri, 24 Mar 2017 06:53:31 +0000 (17:53 +1100)
When registering GstParamSpecArray, use the gst_value_array_get_type()
function to get the type, rather than the GST_TYPE_ARRAY macro, which
gets it from the _gst_value_array_type, which is in turn only
initialised during gst_init()

Fixes criticals with (python) bindings that look up all the
types from the gobject-introspection info as soon as they
are imported.

/usr/lib64/python3.5/site-packages/gi/module.py:178: Warning: g_param_type_register_static: assertion 'g_type_name (pspec_info->value_type) != NULL' failed
  g_type = info.get_g_type()
/usr/lib64/python3.5/site-packages/gi/module.py:212: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  type_ = g_type.pytype
/usr/lib64/python3.5/site-packages/gi/module.py:226: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
/usr/lib64/python3.5/site-packages/gi/module.py:226: Warning: g_type_set_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper

gst/gstparamspecs.c

index 8fad46f..61acc7a 100644 (file)
@@ -313,7 +313,7 @@ gst_param_spec_array_get_type (void)
       _gst_param_array_validate,        /* value_validate    */
       _gst_param_array_values_cmp,      /* values_cmp        */
     };
-    pspec_info.value_type = GST_TYPE_ARRAY;
+    pspec_info.value_type = gst_value_array_get_type ();
     type = g_param_type_register_static ("GstParamArray", &pspec_info);
   }
   return type;