mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-bridge: Update client properties
This commit is contained in:
parent
949f923b80
commit
630889493c
1 changed files with 8 additions and 10 deletions
|
|
@ -1015,29 +1015,27 @@ static int do_set_client_name(struct client *client, uint32_t command, uint32_t
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
struct data reply;
|
struct data reply;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
struct pw_properties *props;
|
int res, changed = 0;
|
||||||
int res;
|
|
||||||
|
|
||||||
props = pw_properties_new(NULL, NULL);
|
|
||||||
|
|
||||||
if (client->version < 13) {
|
if (client->version < 13) {
|
||||||
if ((res = data_get(d,
|
if ((res = data_get(d,
|
||||||
TAG_STRING, &name,
|
TAG_STRING, &name,
|
||||||
TAG_INVALID)) < 0)
|
TAG_INVALID)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
if (name)
|
||||||
|
changed += pw_properties_set(client->props, "application.name", name);
|
||||||
} else {
|
} else {
|
||||||
if ((res = data_get(d,
|
if ((res = data_get(d,
|
||||||
TAG_PROPLIST, props,
|
TAG_PROPLIST, client->props,
|
||||||
TAG_INVALID)) < 0)
|
TAG_INVALID)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
changed++;
|
||||||
}
|
}
|
||||||
if (name)
|
if (changed)
|
||||||
pw_properties_set(props, "application.name", name);
|
pw_core_update_properties(client->core, &client->props->dict);
|
||||||
|
|
||||||
pw_log_info(NAME" %p: SET_CLIENT_NAME %s", impl,
|
pw_log_info(NAME" %p: SET_CLIENT_NAME %s", impl,
|
||||||
pw_properties_get(props, "application.name"));
|
pw_properties_get(client->props, "application.name"));
|
||||||
|
|
||||||
pw_properties_free(props);
|
|
||||||
|
|
||||||
spa_zero(reply);
|
spa_zero(reply);
|
||||||
reply.data = buffer;
|
reply.data = buffer;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue