pulse-server: improve module args compatibility

Boolean switches can also be true with 'y', 'yes', 't' and 'on'
This commit is contained in:
Wim Taymans 2021-09-21 17:37:39 +02:00
parent 310e6009ca
commit c8f629a0a3
6 changed files with 14 additions and 5 deletions

View file

@ -227,6 +227,14 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str
return 0;
}
bool module_args_parse_bool(const char *v)
{
if (spa_streq(v, "1") || !strcasecmp(v, "y") || !strcasecmp(v, "t") ||
!strcasecmp(v, "yes") || !strcasecmp(v, "true") || !strcasecmp(v, "on"))
return true;
return false;
}
#include "modules/registry.h"
static const struct module_info module_list[] = {