From c8efa0fae275c66976b4fd9faea89c7b3777587c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 May 2024 09:33:38 +0200 Subject: [PATCH] context: use first data-loop class when unset When a node does not specify a data-loop class, use the class of the first data loop. This makes the nodes spread out over the first (default) data-loop class. --- src/pipewire/context.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pipewire/context.c b/src/pipewire/context.c index dbf5bb2e3..8aa3a24ca 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -665,10 +665,8 @@ static struct pw_data_loop *acquire_data_loop(struct impl *impl, const char *nam const char *ln = l->impl->loop->name; int score = 0; - if (!name && !klass) { - best_loop = l; - break; - } + if (klass == NULL) + klass = l->impl->class; if (name && ln && fnmatch(name, ln, FNM_EXTMATCH) == 0) score += 2;