pulse: fallback when default sink/source not set

When we ask for the default sink/source and it is not set,
take the highest priority sink/source as the default.
This commit is contained in:
Wim Taymans 2020-09-17 20:12:25 +02:00
parent a01cf5eeda
commit 644a35a559

View file

@ -200,7 +200,7 @@ struct global *pa_context_find_global_by_name(pa_context *c, uint32_t mask, cons
strncmp(str, name, strlen(name) - 8) == 0) strncmp(str, name, strlen(name) - 8) == 0)
return g; return g;
} }
if (g->id == id || (g->id == (id & PA_IDX_MASK_MONITOR))) if (id == SPA_ID_INVALID || g->id == id || (g->id == (id & PA_IDX_MASK_MONITOR)))
return g; return g;
} }
return NULL; return NULL;