media-session: recheck route status when != available

Save the new state so we can detect changes
Check for available != yes to also recheck when the state becomes
unknown.
This commit is contained in:
Wim Taymans 2021-01-29 17:23:02 +01:00
parent f43bcca35e
commit 8fd120cb23

View file

@ -598,7 +598,7 @@ static int handle_route(struct device *dev, struct route *r)
i->restore = false; i->restore = false;
restore = true; restore = true;
} else { } else {
if (r->available == SPA_PARAM_AVAILABILITY_no && i->available != r->available) { if (r->available != SPA_PARAM_AVAILABILITY_yes && i->available != r->available) {
/* an existing port has changed to unavailable */ /* an existing port has changed to unavailable */
pw_log_info("device %d: route '%s' not available", dev->id, r->name); pw_log_info("device %d: route '%s' not available", dev->id, r->name);
@ -615,6 +615,7 @@ static int handle_route(struct device *dev, struct route *r)
restore = true; restore = true;
} }
} }
i->available = r->available;
} }
i->generation = dev->generation; i->generation = dev->generation;