# HG changeset patch # User michael # Date 1006811148 0 # Node ID ce34f5b402720601725cf0c3104f4a683565c649 # Parent 86910f54c3917ae7ccd0faccfc4809f9fadb23b3 runtime cpu detection diff -r 86910f54c391 -r ce34f5b40272 dec_video.c --- a/dec_video.c Mon Nov 26 21:17:23 2001 +0000 +++ b/dec_video.c Mon Nov 26 21:45:48 2001 +0000 @@ -50,6 +50,8 @@ #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 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 @@ } // 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;