mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
spa: add spa_atob() to convert a string to a boolean
This replaces the manual check for "true" and some (inconsistent) return value of atoi. All those instances now require either "true" or "1" to parse as true, any other value (including NULL) is boolean false.
This commit is contained in:
parent
4e70799922
commit
cdfd50e166
18 changed files with 58 additions and 34 deletions
|
|
@ -337,7 +337,7 @@ static void follower_info(void *data, const struct spa_node_info *info)
|
|||
|
||||
if (info->props) {
|
||||
if ((str = spa_dict_lookup(info->props, SPA_KEY_NODE_DRIVER)) != NULL)
|
||||
this->driver = spa_streq(str, "true") || atoi(str) == 1;
|
||||
this->driver = spa_atob(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue