From 644a35a55903b6069339514b87e400aee7ac66a4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 17 Sep 2020 20:12:25 +0200 Subject: [PATCH] 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. --- pipewire-pulseaudio/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipewire-pulseaudio/src/context.c b/pipewire-pulseaudio/src/context.c index c9fbe6be9..929e6561a 100644 --- a/pipewire-pulseaudio/src/context.c +++ b/pipewire-pulseaudio/src/context.c @@ -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) 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 NULL;