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

Rémi Denis-Courmont remi at remlab.net
Thu Dec 9 23:03:22 CET 2010

On Thu, 9 Dec 2010 13:54:11 +0100, "Steinar H. Gunderson"
<sgunderson at bigfoot.com> wrote:
> On Thu, Dec 09, 2010 at 02:49:27PM +0200, Kaarlo Räihä wrote:
>> Yes (albeit they aren't only x86 CPUs used in Win32 systems). And
>> x86/x64 assembly code timers are also option in case Win32 API doesn't
>> provide needed solution (IIRC some games use these).
> Please don't use RDTSC. They're not correctly updated across sleep states
> on all processors (much less suspend/resume); they are _not in sync_
> cores (so as your process is migrated, it can easily jump back and forth
> -- a _lot_), usally do not respect CPU frequency scaling, and so on.

Yes. And that's one of the suspected problem with the current code too.

> Generally, my impression is that the most appropriate timer you have is
> the one in the sound card (unless you happen to have an external clock,
> like in SDI), but I have no idea how it is easy to get VLC to work with
> this.

I fail to see how that could work. There are many scenarios where VLC needs
a clock, yet it is not using "the" sound card. Besides, I suppose the sound
card timer cannot be read directly, but can only be inferred from the audio
hardware buffer state.

Rémi Denis-Courmont

More information about the vlc-devel mailing list