use id to store default sink/source

This is easier to handle in general and we should not use the name
as a unique id. If the session manager wants to save things, it can
use whatever fields it wants from the object to create a unique
persistent name.
This commit is contained in:
Wim Taymans 2020-07-23 11:59:13 +02:00
parent db0c224b06
commit 266e1301d2
5 changed files with 72 additions and 94 deletions

View file

@ -1619,8 +1619,10 @@ static void do_default_node(pa_operation *o, void *userdata)
if (g == NULL) {
error = PA_ERR_NOENTITY;
} else if (c->metadata) {
char buf[16];
snprintf(buf, sizeof(buf), "%d", g->id);
pw_metadata_set_property(c->metadata->proxy,
PW_ID_CORE, d->key, "text/plain", d->name);
PW_ID_CORE, d->key, SPA_TYPE_INFO_BASE"Id", buf);
} else {
error = PA_ERR_NOTIMPLEMENTED;
}