mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-26 07:00:13 -05:00
context: set defaults as properties on the context
This commit is contained in:
parent
5c4be385ad
commit
8b6a163233
1 changed files with 6 additions and 2 deletions
|
|
@ -127,8 +127,10 @@ static uint32_t get_default_int(struct pw_properties *properties, const char *na
|
||||||
const char *str;
|
const char *str;
|
||||||
if ((str = pw_properties_get(properties, name)) != NULL)
|
if ((str = pw_properties_get(properties, name)) != NULL)
|
||||||
val = atoi(str);
|
val = atoi(str);
|
||||||
else
|
else {
|
||||||
val = def;
|
val = def;
|
||||||
|
pw_properties_setf(properties, name, "%d", val);
|
||||||
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,8 +140,10 @@ static bool get_default_bool(struct pw_properties *properties, const char *name,
|
||||||
const char *str;
|
const char *str;
|
||||||
if ((str = pw_properties_get(properties, name)) != NULL)
|
if ((str = pw_properties_get(properties, name)) != NULL)
|
||||||
val = pw_properties_parse_bool(str);
|
val = pw_properties_parse_bool(str);
|
||||||
else
|
else {
|
||||||
val = def;
|
val = def;
|
||||||
|
pw_properties_set(properties, name, val ? "true" : "false");
|
||||||
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue