config: allow passing arguments to pipewire modules

Sometimes, it may be necessary to pass arguments in to a
Pipewire module being loaded. Allow this to be done using
the same format as load_module()/load_optional_module().

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
This commit is contained in:
James Calligeros 2023-11-07 21:57:53 +10:00 committed by George Kiagiadakis
parent 7394f478d6
commit 3fa87510d1

View file

@ -14,10 +14,10 @@ function load_optional_module(m, a)
end
end
function load_pw_module(m)
function load_pw_module(m, a)
assert(type(m) == "string", "module name is mandatory, bail out");
if not components[m] then
components[m] = { "libpipewire-module-" .. m, type = "pw_module" }
components[m] = { "libpipewire-module-" .. m, type = "pw_module", args = a }
end
end