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.
This commit is contained in:
Wim Taymans 2021-02-03 10:02:22 +01:00
parent a48a4fc1bd
commit 8befe9e238

View file

@ -121,7 +121,7 @@ static void select_best(struct selector *s, struct pw_manager_object *o)
if (o->props && if (o->props &&
(str = pw_properties_get(o->props, PW_KEY_PRIORITY_DRIVER)) != NULL) { (str = pw_properties_get(o->props, PW_KEY_PRIORITY_DRIVER)) != NULL) {
prio = pw_properties_parse_int(str); prio = pw_properties_parse_int(str);
if (prio > s->score) { if (s->best == NULL || prio > s->score) {
s->best = o; s->best = o;
s->score = prio; s->score = prio;
} }