author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/multimedia/opieplayer/libmpeg3/video/mmxtest.c | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/video/mmxtest.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/video/mmxtest.c | 35 |
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 | |||
7 | int 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 | } | ||