diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index 1604fdef7..d27b439d3 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -215,7 +215,6 @@ found: SPA_EXPORT int pw_conf_save_state(const char *prefix, const char *name, struct pw_properties *conf) { - const struct spa_dict_item *it; char path[PATH_MAX]; char *tmp_name; int res, sfd, fd, count = 0; @@ -234,14 +233,7 @@ int pw_conf_save_state(const char *prefix, const char *name, struct pw_propertie f = fdopen(fd, "w"); fprintf(f, "{"); - spa_dict_for_each(it, &conf->dict) { - char key[1024]; - - if (spa_json_encode_string(key, sizeof(key)-1, it->key) >= (int)sizeof(key)-1) - continue; - - fprintf(f, "%s\n %s: %s", count++ == 0 ? "" : ",", key, it->value); - } + count += pw_properties_serialize_dict(f, &conf->dict, PW_PROPERTIES_FLAG_NL); fprintf(f, "%s}", count == 0 ? " " : "\n"); fclose(f);