[Mplayer-cvslog] CVS: main cpudetect.c,1.31,1.32 cputable.h,1.6,1.7
D Richard Felker III
dalias at aerifal.cx
Tue Dec 16 20:06:27 CET 2003
On Tue, Dec 16, 2003 at 02:35:27PM +0100, Zoltan Ponekker wrote:
> Update of /cvsroot/mplayer/main
> In directory mail:/var/tmp.root/cvs-serv16217
>
> Modified Files:
> cpudetect.c cputable.h
> Log Message:
>
>
> precise P4 and cpu speed detect
>
> Index: cpudetect.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/cpudetect.c,v
> retrieving revision 1.31
> retrieving revision 1.32
> diff -u -r1.31 -r1.32
> --- cpudetect.c 28 Sep 2003 01:45:54 -0000 1.31
> +++ cpudetect.c 16 Dec 2003 13:35:01 -0000 1.32
> @@ -222,14 +222,19 @@
> {
> unsigned long long int tscstart, tscstop;
> unsigned int start, stop;
> + int i;
> + double total = 0.0;
>
> - tscstart = rdtsc();
> - start = GetTimer();
> - usec_sleep(50000);
> - stop = GetTimer();
> - tscstop = rdtsc();
> -
> - return((tscstop-tscstart)/((stop-start)/1000.0));
> + for ( i=0;i < 10;i++ )
> + {
> + tscstart = rdtsc();
> + start = GetTimer();
> + usec_sleep(50000);
> + stop = GetTimer();
> + tscstop = rdtsc();
> + total+=((tscstop-tscstart)/((stop-start)/1000.0));
> + }
> + return total / 10;
Not acceptable! Please reverse!
This will delay for 500 ms (1/2 second!!!!) at startup!
And it's absolutely useless. This crap (cpu speed detect) should never
have been committed in the first place. You can read the same info
from /proc/cpuinfo.
cvs admin -o 1.32 cpudetect.c
Either you can do it or I'll do it...
Rich
More information about the MPlayer-cvslog
mailing list