[vlc-devel] [PATCH] src: implement monotonic clock for osx

David Fuhrmann david.fuhrmann at gmail.com
Tue Dec 10 22:49:53 CET 2013


Hi Remi,

Am 10.12.2013 um 18:36 schrieb Rémi Denis-Courmont <remi at remlab.net>:

> On Tue, 10 Dec 2013 18:10:55 +0100, david.fuhrmann at gmail.com wrote:
>> From: David Fuhrmann <david.fuhrmann at googlemail.com>
>> 
>> mach_absolute_time seems to be the fastest (and preferred) way to access
>> the high precision timer. It counts mach time units since the last
> system
>> boot. mach_timebase_info provides a conversion factor to transform the
>> value
>> into nano seconds.
> 
> I fail to see how this fits in src/posix(/thread.c)

Yes, strictly speaking it should be moved into the darwin directory. But as most of the code in posix/thread.c is reused in darwin, it may be better to just modify the file in the posix directory for now. And darwin is also called a more or less posix compatible os. :-)

> but most importantly I
> fail to see how this can work without clock selection.

I suppose you are talking about the lack of vlc_clock_id definition?
It works without that because this variable is only used in the cases _POSIX_CLOCK_SELECTION > 0 or _POSIX_TIMERS > 0. Both defines are -1 on osx, so its not needed. And in fact, for the fallback case which was used before (using gettimeofday), this variable is not defined, either.

With best regards,

David


More information about the vlc-devel mailing list