[vlc-devel] QueryPerformanceFrequency suggestion

Kirk Hobart hobart at west.net
Tue Jul 19 13:22:19 CEST 2005


I'm compiling and running VLC 0.8.2 on a dual-Athlon Win2k system.

I suggest adding a preferences advanced option that enables 
QueryPerformanceFrequency in src/misc/mtime.c even if the reported 
frequency is different from the two expected values. Dual-CPU Windows 
machines tell the CPU clock frequency instead of the multimedia timer 

I understand that the current code is "playing it safe" by disabling the 
high performance timer in dual-CPU machines, because some machines have 
unreliable TSC timers. But my machine has good timers, and VLC refuses to 
use them, so my video frame rate is unnecessarily uneven.

To test my theory, I replaced this line:

         freq = ( QueryPerformanceFrequency( (LARGE_INTEGER *)&freq ) &&
                  (freq == I64C(1193182) || freq == I64C(3579545) ) )
                ? freq : 0;

with this line:

         freq = QueryPerformanceFrequency( (LARGE_INTEGER *)&freq )
                ? freq : 0;

and I modified this statement:

         return ( usec_time * 1000000 ) / freq;

to this, to avoid overflow:

         return ( usec_time * 1e6 ) / freq;

I don't know how to add a new preferences advanced option to the dialogs.


This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list