diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index b88e593ca..9b9776605 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -753,3 +753,21 @@ int pw_context_parse_conf_section(struct pw_context *context, return data.count; } + +static int update_props(void *user_data, const char *location, const char *key, + const char *val, size_t len) +{ + struct data *data = user_data; + data->count += pw_properties_update_string(data->props, val, len); + return 0; +} + +SPA_EXPORT +int pw_context_conf_update_props(struct pw_context *context, + const char *section, struct pw_properties *props) +{ + struct data data = { .context = context, .props = props }; + pw_context_conf_section_for_each(context, section, + update_props, &data); + return data.count; +} diff --git a/src/pipewire/context.c b/src/pipewire/context.c index 554ff23b0..6e65a4af4 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -537,20 +537,6 @@ const char *pw_context_get_conf_section(struct pw_context *context, const char * return pw_properties_get(context->conf, section); } -SPA_EXPORT -int pw_context_conf_update_props(struct pw_context *context, - const char *section, struct pw_properties *props) -{ - struct pw_properties *conf = context->conf; - const char *str; - int count = 0; - - if ((str = pw_properties_get(conf, section)) != NULL) - count = pw_properties_update_string(props, str, strlen(str)); - - return count; -} - /** Update context properties * * \param context a context