acp: make sure we pass the save flag around

When we set the volume on a port, make sure we also set the save flag
so that the flag is put into the volume changed event and the session
manager can save it.

Fixes #995
This commit is contained in:
Wim Taymans 2021-03-30 16:06:30 +02:00
parent c50c0b91c5
commit dc3bf68aa2

View file

@ -1743,16 +1743,15 @@ int acp_device_set_port(struct acp_device *dev, uint32_t port_index, uint32_t fl
return -EINVAL;
p = (pa_device_port*)impl->card.ports[port_index];
if (p == old)
return 0;
if (!pa_hashmap_get(d->ports, p->name))
return -EINVAL;
p->port.flags = ACP_PORT_ACTIVE | flags;
if (p == old)
return 0;
if (old)
old->port.flags &= ~(ACP_PORT_ACTIVE | ACP_PORT_SAVE);
d->active_port = p;
p->port.flags |= ACP_PORT_ACTIVE | flags;
if (impl->use_ucm) {
pa_alsa_ucm_port_data *data;