diff options
author | Chris Robinson <[email protected]> | 2011-12-20 01:36:01 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-12-20 01:36:01 -0800 |
commit | 2691c33b555a8e60f6a0ba44c59fb7e167d1e5bd (patch) | |
tree | 69fa7dbae91f30588efa3b64db3d5ae86dc22d46 /Alc | |
parent | 7f6844e48d32225eadd1e918fd0bbb84170a6b15 (diff) |
Use a string to specify the resampler config option
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -583,10 +583,24 @@ static void alc_initconfig(void) #endif ConfigValueInt(NULL, "rt-prio", &RTPrioLevel); - if(ConfigValueInt(NULL, "resampler", &n)) - { - if(n < RESAMPLER_MAX && n > RESAMPLER_MIN) - DefaultResampler = n; + if(ConfigValueStr(NULL, "resampler", &str)) + { + if(strcasecmp(str, "point") == 0 || strcasecmp(str, "none") == 0) + DefaultResampler = POINT_RESAMPLER; + else if(strcasecmp(str, "linear") == 0) + DefaultResampler = LINEAR_RESAMPLER; + else if(strcasecmp(str, "cubic") == 0) + DefaultResampler = CUBIC_RESAMPLER; + else + { + char *end; + + n = strtol(str, &end, 0); + if(*end == '\0' && n < RESAMPLER_MAX && n > RESAMPLER_MIN) + DefaultResampler = n; + else + WARN("Invalid resampler: %s\n", str); + } } if(!TrapALCError) |