mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
jack: lock for accessing the globals
This commit is contained in:
parent
3f844f7b09
commit
136f556d79
1 changed files with 5 additions and 1 deletions
|
|
@ -2012,7 +2012,9 @@ static int metadata_property(void *object, uint32_t id,
|
|||
if (key == NULL || strcmp(key, "default.audio.source") == 0)
|
||||
c->metadata->default_audio_source = val;
|
||||
} else {
|
||||
pthread_mutex_lock(&c->context.lock);
|
||||
o = pw_map_lookup(&c->context.globals, id);
|
||||
pthread_mutex_unlock(&c->context.lock);
|
||||
if (o == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -2148,9 +2150,9 @@ static void registry_event_global(void *data, uint32_t id,
|
|||
|
||||
pthread_mutex_lock(&c->context.lock);
|
||||
spa_list_append(&c->context.ports, &o->link);
|
||||
ot = pw_map_lookup(&c->context.globals, node_id);
|
||||
pthread_mutex_unlock(&c->context.lock);
|
||||
|
||||
ot = pw_map_lookup(&c->context.globals, node_id);
|
||||
if (ot == NULL || ot->type != INTERFACE_Node)
|
||||
goto exit_free;
|
||||
|
||||
|
|
@ -2274,7 +2276,9 @@ static void registry_event_global_remove(void *object, uint32_t id)
|
|||
c->metadata->default_audio_source = SPA_ID_INVALID;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&c->context.lock);
|
||||
o = pw_map_lookup(&c->context.globals, id);
|
||||
pthread_mutex_unlock(&c->context.lock);
|
||||
if (o == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue