From 8fd120cb23e5fb00e4d1936af2cf80238b9f67d2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 29 Jan 2021 17:23:02 +0100 Subject: [PATCH] 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. --- src/examples/media-session/default-routes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/examples/media-session/default-routes.c b/src/examples/media-session/default-routes.c index 9cd7929f3..2dc1e4fd0 100644 --- a/src/examples/media-session/default-routes.c +++ b/src/examples/media-session/default-routes.c @@ -598,7 +598,7 @@ static int handle_route(struct device *dev, struct route *r) i->restore = false; restore = true; } 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 */ 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; } } + i->available = r->available; } i->generation = dev->generation;