aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-13 10:37:49 -0700
committerChris Robinson <[email protected]>2012-08-13 10:37:49 -0700
commit17dfaa3aaef28f38b27c5d797be0a938c4ca38e2 (patch)
treef8c9eeae91028edf32b7df98513c39add41d4e40 /Alc/ALc.c
parent0a3eba08d8af653a4e7ec803b86c458560e14484 (diff)
Add a config option to disable use of CPU extensions
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index b017c480..e664d25a 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -769,6 +769,7 @@ static void alc_init(void)
static void alc_initconfig(void)
{
const char *devs, *str;
+ ALuint capfilter;
float valf;
int i, n;
@@ -790,7 +791,36 @@ static void alc_initconfig(void)
ReadALConfig();
- FillCPUCaps();
+ capfilter = CPU_CAP_ALL;
+ if(ConfigValueStr(NULL, "disable-cpu-exts", &str))
+ {
+ if(strcasecmp(str, "all") == 0)
+ capfilter = 0;
+ else
+ {
+ size_t len;
+ const char *next = str;
+
+ i = 0;
+ do {
+ str = next;
+ next = strchr(str, ',');
+
+ while(isspace(str[0]))
+ str++;
+ if(!str[0] || str[0] == ',')
+ continue;
+
+ len = (next ? ((size_t)(next-str)) : strlen(str));
+ if(strncasecmp(str, "neon", len) == 0)
+ capfilter &= ~CPU_CAP_NEON;
+ else
+ WARN("Invalid CPU extension \"%s\"\n", str);
+ } while(next++);
+ }
+ }
+ FillCPUCaps(capfilter);
+
InitHrtf();
#ifdef _WIN32