From 50de4b188636ab9a126c6031bb5225a2e8c1b3db Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 1 Feb 2022 15:55:17 +0100 Subject: [PATCH] conf: add some properties in the conf Add the path, prefix and name in the config properties. --- src/pipewire/conf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index b63c9dc95..8337c27b1 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -350,7 +350,8 @@ error: return res; } -static int conf_load(const char *path, struct pw_properties *conf) +static int conf_load(const char *path, const char *prefix, const char *name, + struct pw_properties *conf) { char *data; struct stat sbuf; @@ -371,6 +372,10 @@ static int conf_load(const char *path, struct pw_properties *conf) pw_properties_update_string(conf, data, sbuf.st_size); munmap(data, sbuf.st_size); + pw_properties_set(conf, "config.path", path); + pw_properties_set(conf, "config.prefix", prefix); + pw_properties_set(conf, "config.name", name); + return 0; error_close: @@ -392,8 +397,7 @@ int pw_conf_load_conf(const char *prefix, const char *name, struct pw_properties pw_log_debug("%p: can't load config '%s': %m", conf, path); return -ENOENT; } - - return conf_load(path, conf); + return conf_load(path, prefix, name, conf); } SPA_EXPORT @@ -410,8 +414,7 @@ int pw_conf_load_state(const char *prefix, const char *name, struct pw_propertie pw_log_debug("%p: can't load config '%s': %m", conf, path); return -ENOENT; } - - return conf_load(path, conf); + return conf_load(path, prefix, name, conf); } /* context.spa-libs = {