project: Accept NULL as a valid value for @id in _create_asset
authorThibault Saunier <thibault.saunier@collabora.com>
Fri, 19 Apr 2013 22:58:21 +0000 (19:58 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Fri, 19 Apr 2013 22:59:26 +0000 (19:59 -0300)
ges/ges-project.c

index f6ced090a59a762868c6f73b16b4d5cf7e7a423e..1fc2e24752487d3f8605d63adfb0b211115a643e 100644 (file)
@@ -538,7 +538,7 @@ ges_project_add_loading_asset (GESProject * project, GType extractable_type,
 /**
  * ges_project_create_asset:
  * @project: A #GESProject
- * @id: The id of the asset to create and add to @project
+ * @id: (allow-none): The id of the asset to create and add to @project
  * @extractable_type: The #GType of the asset to create
  *
  * Create and add a #GESAsset to @project. You should connect to the
@@ -556,6 +556,9 @@ ges_project_create_asset (GESProject * project, const gchar * id,
   g_return_val_if_fail (g_type_is_a (extractable_type, GES_TYPE_EXTRACTABLE),
       FALSE);
 
+  if (id == NULL)
+    id = g_type_name (extractable_type);
+
   if (g_hash_table_lookup (project->priv->assets, id) ||
       g_hash_table_lookup (project->priv->loading_assets, id) ||
       g_hash_table_lookup (project->priv->loaded_with_error, id))