media-session: restored saved profile from off

Always attempt to restore the saved profile again from the off state.
This can happen when the device goes into suspend or when hdmi is
unplugged.
This commit is contained in:
Wim Taymans 2021-03-17 12:23:58 +01:00
parent 14e8073d18
commit 35c27d0c10

View file

@ -260,6 +260,11 @@ static int handle_active_profile(struct device *dev)
if ((res = find_current_profile(dev, &pr)) < 0) if ((res = find_current_profile(dev, &pr)) < 0)
return res; return res;
/* when the active profile is off, always try to restored the saved
* profile again */
if (strcmp(pr.name, "off") == 0)
dev->restored = false;
if (dev->active_profile == pr.index) { if (dev->active_profile == pr.index) {
/* no change, we're done */ /* no change, we're done */
pw_log_info("device '%s': active profile '%s'", dev->name, pr.name); pw_log_info("device '%s': active profile '%s'", dev->name, pr.name);