aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/cpu.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-03-04 16:08:48 +0100
committerAnton Khirnov <anton@khirnov.net>2012-03-06 15:02:28 +0100
commit4d851f8dcf951d380e935ef14ae01db813adfc2d (patch)
treebd5610a073c4d4292b6caa6b9ebe840bad168eac /libavutil/cpu.c
parent338978a7c17d303672bcf5e035e54da362274a18 (diff)
downloadffmpeg-4d851f8dcf951d380e935ef14ae01db813adfc2d.tar.gz
cpu: add av_set_cpu_flags_mask().
Diffstat (limited to 'libavutil/cpu.c')
-rw-r--r--libavutil/cpu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 25895d6d5d..e72f7231a8 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -19,9 +19,11 @@
#include "cpu.h"
#include "config.h"
+static int cpuflags_mask, checked;
+
int av_get_cpu_flags(void)
{
- static int flags, checked;
+ static int flags;
if (checked)
return flags;
@@ -30,10 +32,18 @@ int av_get_cpu_flags(void)
if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
if (ARCH_X86) flags = ff_get_cpu_flags_x86();
+ flags &= cpuflags_mask;
checked = 1;
+
return flags;
}
+void av_set_cpu_flags_mask(int mask)
+{
+ cpuflags_mask = mask;
+ checked = 0;
+}
+
#ifdef TEST
#undef printf