context: avoid adding duplicate export types

This commit is contained in:
Wim Taymans 2020-06-03 13:01:32 +02:00
parent 8d0913c9d8
commit 702976ab9c

View file

@ -1021,6 +1021,10 @@ struct spa_handle *pw_context_load_spa_handle(struct pw_context *context,
SPA_EXPORT
int pw_context_register_export_type(struct pw_context *context, struct pw_export_type *type)
{
if (pw_context_find_export_type(context, type->type)) {
pw_log_warn("context %p: duplicate export type %s", context, type->type);
return -EEXIST;
}
pw_log_debug("context %p: Add export type %s to context", context, type->type);
spa_list_append(&context->export_list, &type->link);
return 0;