context: set defaults as properties on the context

This commit is contained in:
Wim Taymans 2020-02-05 11:49:28 +01:00
parent 5c4be385ad
commit 8b6a163233

View file

@ -127,8 +127,10 @@ static uint32_t get_default_int(struct pw_properties *properties, const char *na
const char *str;
if ((str = pw_properties_get(properties, name)) != NULL)
val = atoi(str);
else
else {
val = def;
pw_properties_setf(properties, name, "%d", val);
}
return val;
}
@ -138,8 +140,10 @@ static bool get_default_bool(struct pw_properties *properties, const char *name,
const char *str;
if ((str = pw_properties_get(properties, name)) != NULL)
val = pw_properties_parse_bool(str);
else
else {
val = def;
pw_properties_set(properties, name, val ? "true" : "false");
}
return val;
}