From 1b16261c7c435bd43a38132493dcd2cf16242f89 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 26 Nov 2001 21:45:48 +0000 Subject: [PATCH] runtime cpu detection git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3145 b3059339-0415-0410-9bf9-f77b7e298cf2 --- dec_video.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dec_video.c b/dec_video.c index 378eb252cc..0e88cbd3c7 100644 --- a/dec_video.c +++ b/dec_video.c @@ -50,6 +50,8 @@ extern int frameratecode2framerate[16]; #include "postproc/postprocess.h" +#include "cpudetect.h" + extern picture_t *picture; // exported from libmpeg2/decode.c int divx_quality=0; @@ -101,8 +103,6 @@ extern int tv_param_on; extern tvi_handle_t *tv_handler; #endif -#include "mmx_defs.h" - void AVI_Decode_RLE8(char *image,char *delta,int tdsize, unsigned int *map,int imagex,int imagey,unsigned char x11_bytes_pixel); @@ -808,11 +808,14 @@ if(verbose>1){ } // switch //------------------------ frame decoded. -------------------- -#ifdef HAVE_MMX // some codecs is broken, and doesn't restore MMX state :( // it happens usually with broken/damaged files. - __asm __volatile (EMMS:::"memory"); -#endif +if(gCpuCaps.has3DNow){ + __asm __volatile ("femms\n\t":::"memory"); +} +else if(gCpuCaps.hasMMX){ + __asm __volatile ("emms\n\t":::"memory"); +} t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;