media-session: try to avoid switching away from hdmi

When HDMI goes to sleep the profile becomes unavailable. Avoid
switching to Off in that case.
This commit is contained in:
Wim Taymans 2021-01-28 15:41:14 +01:00
parent fc08c79dad
commit f03deb5324
2 changed files with 7 additions and 1 deletions

View file

@ -271,6 +271,11 @@ static int handle_profile(struct device *dev)
pw_log_info("device '%s': active profile '%s' unavailable", pw_log_info("device '%s': active profile '%s' unavailable",
dev->name, pr.name); dev->name, pr.name);
/* ignore hdmi profile removal of unavailable, this can happen
* when the screen is put to sleep */
if (strstr(pr.name, "hdmi") != NULL)
return 0;
dev->restored = false; dev->restored = false;
} }
} }

View file

@ -372,6 +372,7 @@ static struct route_info *find_route_info(struct device *dev, struct route *r)
if (i == NULL) if (i == NULL)
return NULL; return NULL;
pw_log_info("device %d: new route %d '%s' found", dev->id, r->index, r->name);
i->index = r->index; i->index = r->index;
i->generation = dev->generation; i->generation = dev->generation;
@ -417,8 +418,8 @@ static int handle_route(struct device *dev, struct route *r)
add_idle_timeout(impl); add_idle_timeout(impl);
} }
free(val); free(val);
i->generation = dev->generation;
} }
i->generation = dev->generation;
return 0; return 0;
} }