summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
Side-by-side diff
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.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 @@
+#include "../libmpeg3.h"
+#include "../mpeg3protos.h"
+
+#include <stdio.h>
+#include <string.h>
+
+int mpeg3_mmx_test()
+{
+ int result = 0;
+ FILE *proc;
+ char string[MPEG3_STRLEN];
+
+
+#ifdef HAVE_MMX
+ if(!(proc = fopen(MPEG3_PROC_CPUINFO, "r")))
+ {
+ return 0;
+ }
+
+ while(!feof(proc))
+ {
+ fgets(string, MPEG3_STRLEN, proc);
+/* Got the flags line */
+ if(!strncmp(string, "flags", 5))
+ {
+ char *needle;
+ needle = strstr(string, "mmx");
+ if(!needle) return 0;
+ if(!strncmp(needle, "mmx", 3)) return 1;
+ }
+ }
+#endif
+
+ return 0;
+}