aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-04-16 20:13:50 -0700
committerChris Robinson <[email protected]>2012-04-16 20:13:50 -0700
commitf6a1e53f191212112a5c31803c7018387d8aa715 (patch)
treea48acf3092b06552222144403d96839c98aa2faa /Alc/ALc.c
parenta0a015f19fcda6fe1ccd6d20f361a2abedbddc1a (diff)
Read ALSOFT_TRAP_*ERROR when reading the config
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 52ba6801..c752d186 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -498,23 +498,6 @@ static void alc_init(void)
if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
ZScale = -1.0f;
- str = getenv("ALSOFT_TRAP_ERROR");
- if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
- {
- TrapALError = AL_TRUE;
- TrapALCError = AL_TRUE;
- }
- else
- {
- str = getenv("ALSOFT_TRAP_AL_ERROR");
- if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
- TrapALError = AL_TRUE;
-
- str = getenv("ALSOFT_TRAP_ALC_ERROR");
- if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
- TrapALCError = ALC_TRUE;
- }
-
pthread_key_create(&LocalContext, ReleaseThreadCtx);
InitializeCriticalSection(&ListLock);
ThunkInit();
@@ -605,11 +588,24 @@ static void alc_initconfig(void)
}
}
- if(!TrapALCError)
- TrapALCError = GetConfigValueBool(NULL, "trap-alc-error", ALC_FALSE);
+ str = getenv("ALSOFT_TRAP_ERROR");
+ if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
+ {
+ TrapALError = AL_TRUE;
+ TrapALCError = AL_TRUE;
+ }
+ else
+ {
+ str = getenv("ALSOFT_TRAP_AL_ERROR");
+ if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
+ TrapALError = AL_TRUE;
+ TrapALError = GetConfigValueBool(NULL, "trap-al-error", TrapALError);
- if(!TrapALError)
- TrapALError = GetConfigValueBool(NULL, "trap-al-error", AL_FALSE);
+ str = getenv("ALSOFT_TRAP_ALC_ERROR");
+ if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
+ TrapALCError = ALC_TRUE;
+ TrapALCError = GetConfigValueBool(NULL, "trap-alc-error", TrapALCError);
+ }
if(ConfigValueFloat("reverb", "boost", &valf))
ReverbBoost *= aluPow(10.0f, valf / 20.0f);