From 8befe9e2386b7e3b9f8818f79707cc6c726bac51 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 3 Feb 2021 10:02:22 +0100 Subject: [PATCH] pulse-server: allow objects with priority 0 to be default Also use the object with priority 0 as a best option when there is not yet anything else. --- src/modules/module-protocol-pulse/collect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index 5a80d1849..f0e6b80fc 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -121,7 +121,7 @@ static void select_best(struct selector *s, struct pw_manager_object *o) if (o->props && (str = pw_properties_get(o->props, PW_KEY_PRIORITY_DRIVER)) != NULL) { prio = pw_properties_parse_int(str); - if (prio > s->score) { + if (s->best == NULL || prio > s->score) { s->best = o; s->score = prio; }