From 8d0f7388826df6a2c60c5f661f90edb2adc3a098 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Mar 2024 17:00:56 +0100 Subject: [PATCH] conf: only count modules, objects and exec when added We don't actually do anything when the name, factory or path is NULL so don't count this as an action. Commenting out these keys is a usual way for commenting out complete sections. --- src/pipewire/conf.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index 0cc1b95b0..2ef841778 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -730,13 +730,12 @@ static int parse_modules(void *user_data, const char *location, if (!have_match) continue; - if (name != NULL) + if (name != NULL) { res = load_module(context, name, args, flags); - - if (res < 0) - break; - - d->count++; + if (res < 0) + break; + d->count++; + } } return res; @@ -832,12 +831,12 @@ static int parse_objects(void *user_data, const char *location, if (!have_match) continue; - if (factory != NULL) + if (factory != NULL) { res = create_object(context, factory, args, flags); - - if (res < 0) - break; - d->count++; + if (res < 0) + break; + d->count++; + } } return res; @@ -942,13 +941,12 @@ static int parse_exec(void *user_data, const char *location, if (!have_match) continue; - if (path != NULL) + if (path != NULL) { res = do_exec(context, path, args); - - if (res < 0) - break; - - d->count++; + if (res < 0) + break; + d->count++; + } } return res;