Browse code

cpudetect: add av_force_cpu_flags()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/06/02 23:09:22
Showing 3 changed files
... ...
@@ -40,7 +40,7 @@
40 40
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
41 41
 
42 42
 #define LIBAVUTIL_VERSION_MAJOR 51
43
-#define LIBAVUTIL_VERSION_MINOR  3
43
+#define LIBAVUTIL_VERSION_MINOR  4
44 44
 #define LIBAVUTIL_VERSION_MICRO  0
45 45
 
46 46
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
... ...
@@ -19,10 +19,15 @@
19 19
 #include "cpu.h"
20 20
 #include "config.h"
21 21
 
22
+static int flags, checked;
23
+
24
+void av_force_cpu_flags(int arg){
25
+    flags   = arg;
26
+    checked = 1;
27
+}
28
+
22 29
 int av_get_cpu_flags(void)
23 30
 {
24
-    static int flags, checked;
25
-
26 31
     if (checked)
27 32
         return flags;
28 33
 
... ...
@@ -46,6 +46,13 @@
46 46
  */
47 47
 int av_get_cpu_flags(void);
48 48
 
49
+
50
+/**
51
+ * Disables cpu detection and forces the specified flags.
52
+ */
53
+void av_force_cpu_flags(int flags);
54
+
55
+
49 56
 /* The following CPU-specific functions shall not be called directly. */
50 57
 int ff_get_cpu_flags_arm(void);
51 58
 int ff_get_cpu_flags_ppc(void);