client: update permission before calling global_update

first update the permission and then call the global update method. This
ensures that any query of the permissions will have the new permissions.
This commit is contained in:
Wim Taymans 2019-05-13 17:58:58 +02:00
parent 04c153d410
commit 79fe89412a

View file

@ -491,13 +491,14 @@ int pw_client_update_permissions(struct pw_client *client,
pw_log_debug("client %p: set default permissions %08x -> %08x",
client, old_perm, new_perm);
def->permissions = new_perm;
spa_list_for_each(global, &core->global_list, link) {
p = find_permission(client, global->id);
if (p->id != SPA_ID_INVALID)
continue;
pw_global_update_permissions(global, client, old_perm, new_perm);
}
def->permissions = new_perm;
}
else {
struct pw_global *global;
@ -517,8 +518,8 @@ int pw_client_update_permissions(struct pw_client *client,
pw_log_debug("client %p: set global %d permissions %08x -> %08x",
client, global->id, old_perm, new_perm);
pw_global_update_permissions(global, client, old_perm, new_perm);
p->permissions = new_perm;
pw_global_update_permissions(global, client, old_perm, new_perm);
}
}
if (n_permissions > 0)