mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-12 13:30:15 -05:00
Return -EEXIST when registering an object twice
This commit is contained in:
parent
92808809ec
commit
c67f903c61
4 changed files with 13 additions and 0 deletions
|
|
@ -215,6 +215,9 @@ int pw_client_register(struct pw_client *client,
|
|||
{
|
||||
struct pw_core *core = client->core;
|
||||
|
||||
if (client->registered)
|
||||
return -EEXIST;
|
||||
|
||||
pw_log_debug("client %p: register parent %d", client, parent ? parent->id : SPA_ID_INVALID);
|
||||
|
||||
spa_list_append(&core->client_list, &client->link);
|
||||
|
|
|
|||
|
|
@ -142,6 +142,9 @@ int pw_factory_register(struct pw_factory *factory,
|
|||
{
|
||||
struct pw_core *core = factory->core;
|
||||
|
||||
if (factory->registered)
|
||||
return -EEXIST;
|
||||
|
||||
if (properties == NULL)
|
||||
properties = pw_properties_new(NULL, NULL);
|
||||
if (properties == NULL)
|
||||
|
|
|
|||
|
|
@ -1280,6 +1280,9 @@ int pw_link_register(struct pw_link *link,
|
|||
struct pw_core *core = link->core;
|
||||
struct pw_node *input_node, *output_node;
|
||||
|
||||
if (link->registered)
|
||||
return -EEXIST;
|
||||
|
||||
if (properties == NULL)
|
||||
properties = pw_properties_new(NULL, NULL);
|
||||
if (properties == NULL)
|
||||
|
|
|
|||
|
|
@ -426,6 +426,9 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
struct pw_type *t = &core->type;
|
||||
const char *str, *dir;
|
||||
|
||||
if (port->node != NULL)
|
||||
return -EEXIST;
|
||||
|
||||
port->node = node;
|
||||
|
||||
spa_node_port_get_info(node->node,
|
||||
|
|
@ -537,6 +540,7 @@ static void pw_port_remove(struct pw_port *port)
|
|||
}
|
||||
spa_list_remove(&port->link);
|
||||
pw_node_events_port_removed(node, port);
|
||||
port->node = NULL;
|
||||
}
|
||||
|
||||
void pw_port_destroy(struct pw_port *port)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue