diff options
author | Chris Robinson <[email protected]> | 2019-08-12 17:10:04 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-12 17:10:04 -0700 |
commit | bc9f39b5ac69b34cb3d278e5573dc63811a0c442 (patch) | |
tree | 8416e8001488dc7f418d30d303206942bbceaeba /alc | |
parent | 38a565bdf8ab9f7da601dd12f03cdc8f9b37f23c (diff) |
Environment variables should override config settings
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index d4cf040a..6a39ab46 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1051,21 +1051,17 @@ void alc_initconfig(void) { traperr = al::getenv("ALSOFT_TRAP_AL_ERROR"); if(traperr) - { - if(strcasecmp(traperr->c_str(), "true") == 0 - || strtol(traperr->c_str(), nullptr, 0) == 1) - TrapALError = true; - } - TrapALError = !!GetConfigValueBool(nullptr, nullptr, "trap-al-error", TrapALError); + TrapALError = strcasecmp(traperr->c_str(), "true") == 0 + || strtol(traperr->c_str(), nullptr, 0) == 1; + else + TrapALError = !!GetConfigValueBool(nullptr, nullptr, "trap-al-error", false); traperr = al::getenv("ALSOFT_TRAP_ALC_ERROR"); if(traperr) - { - if(strcasecmp(traperr->c_str(), "true") == 0 - || strtol(traperr->c_str(), nullptr, 0) == 1) - TrapALCError = true; - } - TrapALCError = !!GetConfigValueBool(nullptr, nullptr, "trap-alc-error", TrapALCError); + TrapALCError = strcasecmp(traperr->c_str(), "true") == 0 + || strtol(traperr->c_str(), nullptr, 0) == 1; + else + TrapALCError = !!GetConfigValueBool(nullptr, nullptr, "trap-alc-error", false); } if(auto boostopt = ConfigValueFloat(nullptr, "reverb", "boost")) |