project: Accept NULL as a valid value for @id in _create_asset

This commit is contained in:
Thibault Saunier 2013-04-19 19:58:21 -03:00
parent 0c900f7bc6
commit 723fee10b6

View 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))