gboolean res;
if (G_VALUE_TYPE (value) != GST_TYPE_STRUCTURE) {
- GST_WARNING ("expected field of type GstStructure, but %s is %s",
+ GST_ERROR ("expected field of type GstStructure, but %s is %s",
g_quark_to_string (field_id), G_VALUE_TYPE_NAME (value));
return FALSE;
}
/* all fields passed here must be GstStructures which we take over */
if (type != GST_TYPE_STRUCTURE) {
- GST_WARNING ("expected field of type GstStructure, but %s is %s",
+ GST_ERROR ("expected field of type GstStructure, but %s is %s",
firstfield, g_type_name (type));
+ va_end (varargs);
+ gst_structure_free (structure);
+ return NULL;
}
G_VALUE_COLLECT_INIT (&val, type, varargs, G_VALUE_NOCOPY_CONTENTS, &err);
g_free (err);
break;
}
- /* see boxed_proxy_collect_value */
+ /* give ownership of the GstStructure "value" collected from varargs
+ * to this structure by unsetting the NOCOPY_CONTENTS collect-flag.
+ * see boxed_proxy_collect_value in glib's gobject/gboxed.c */
val.data[1].v_uint &= ~G_VALUE_NOCOPY_CONTENTS;
gst_structure_id_take_value (structure, id, &val);