pipewire: Add option to disable config files

Add env variable PIPEWIRE_NO_CONFIG to disable parsing
custom config files.
Add a method to check extra options.
Expose valgrind, no-config and no-color as options.
This commit is contained in:
Wim Taymans 2021-06-02 15:55:24 +02:00
parent dde03a7dd3
commit 58d0e44664
3 changed files with 29 additions and 3 deletions

View file

@ -76,6 +76,8 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char
return 1;
return -ENOENT;
}
if (pw_check_option("no-config", "true"))
goto no_config;
dir = getenv("PIPEWIRE_CONFIG_DIR");
if (dir != NULL) {
@ -112,6 +114,7 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char
access(path, R_OK) == 0)
return 1;
}
no_config:
dir = PIPEWIRE_CONFDATADIR;
if (dir != NULL) {
const char *paths[] = { dir, prefix, name, NULL };