From cddea858d9e8894d777b1830d76db18e57791e29 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Mar 2024 17:08:33 +0100 Subject: [PATCH] context: add context.modules.allow-empty property false by default, when true, no warning will be logged when the context.modules in the config is empty. This can be useful when the application wants to load all the modules itself. --- doc/dox/config/pipewire.conf.5.md | 5 +++++ src/pipewire/context.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/dox/config/pipewire.conf.5.md b/doc/dox/config/pipewire.conf.5.md index e58909cce..4a143cc6c 100644 --- a/doc/dox/config/pipewire.conf.5.md +++ b/doc/dox/config/pipewire.conf.5.md @@ -253,6 +253,11 @@ Any property in the vm.overrides property object will override the property in the context.properties when PipeWire detects it is running in a VM. This is deprected, use the context.properties.rules instead. +@PAR@ pipewire.conf context.modules.allow-empty = false +By default, a warning is logged when there are no context.modules loaded because this +likely indicates there is a problem. Some applications might load the modules themselves +and when they set this property to true, no warning will be logged. + The context properties may also contain custom values. For example, the `context.modules` and `context.objects` sections can declare additional conditions that control whether a module or object is loaded diff --git a/src/pipewire/context.c b/src/pipewire/context.c index a94119af9..e2e8d2fc9 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -357,7 +357,7 @@ struct pw_context *pw_context_new(struct pw_loop *main_loop, pw_log_info("%p: parsed %d context.spa-libs items", this, res); if ((res = pw_context_parse_conf_section(this, conf, "context.modules")) < 0) goto error_free; - if (res > 0) + if (res > 0 || pw_properties_get_bool(properties, "context.modules.allow-empty", false)) pw_log_info("%p: parsed %d context.modules items", this, res); else pw_log_warn("%p: no modules loaded from context.modules", this);