[vlc-devel] [RFC] revert Win32: always use the performance timers

Laurent Aimar fenrir at elivagar.org
Fri Dec 10 00:02:34 CET 2010


On Thu, Dec 09, 2010 at 11:06:12PM +0100, Rémi Denis-Courmont wrote:
> 
> On Thu, 9 Dec 2010 09:24:48 +0100, XilasZ <xilasz at gmail.com> wrote:
> > Would it be possible to use one timer for amd users, and the other one
> for
> > intel users ?
> 
> Are we sure the problem only affects AMD users? Do we have a reliably way
> to check the CPU vendor? CPUID?
 From what I read from the internet, it's a bit more complicated. For example:
http://www.gamedev.net/reference/articles/article2086.asp
http://support.microsoft.com/kb/895980
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q274323& (which is scary).
http://www.gamedev.net/reference/programming/features/timing/ (seems to have been used
to designed the old code).

 So depending on the type of clock used behind the hood for QueryPerformanceCounter
either you have a really good timer or an completely broken/useless one. And I didn't
see anyway to detect reliably the type. The old VLC code tried to do it (dunno if it
was working correctly in all cases).

 What I don't understand is why timeGetTime() does not work. I haven't seen any
docs reporting issue with it except when you reduce the scheduler period
(with timeBeginPeriod) as it increase the CPU load.

> Otherwise, there's GetSystemTime() running at 1 kHz, or
> GetSystemTimeAsFileTime() at 10 MHz (not sure if it is converted from 1 kHz
> though). But I guess they will explode if the user or the NTP service
> adjusts the clock.
 I think in this case you can use GetTickCount, but its resolution can be very bad
(up to ~50 ms), making it pretty useless too.

-- 
fenrir



More information about the vlc-devel mailing list