summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/video/mmxtest.c
blob: 567f139983df56c093e135b156393814c27e5198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}