summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
downloadopie-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.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;
+}