summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/video/mmxtest.c') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/video/mmxtest.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c b/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
new file mode 100644
index 0000000..567f139
--- a/dev/null
+++ b/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
@@ -0,0 +1,35 @@
1#include "../libmpeg3.h"
2#include "../mpeg3protos.h"
3
4#include <stdio.h>
5#include <string.h>
6
7int mpeg3_mmx_test()
8{
9 int result = 0;
10 FILE *proc;
11 char string[MPEG3_STRLEN];
12
13
14#ifdef HAVE_MMX
15 if(!(proc = fopen(MPEG3_PROC_CPUINFO, "r")))
16 {
17 return 0;
18 }
19
20 while(!feof(proc))
21 {
22 fgets(string, MPEG3_STRLEN, proc);
23/* Got the flags line */
24 if(!strncmp(string, "flags", 5))
25 {
26 char *needle;
27 needle = strstr(string, "mmx");
28 if(!needle) return 0;
29 if(!strncmp(needle, "mmx", 3)) return 1;
30 }
31 }
32#endif
33
34 return 0;
35}