[vlc-devel] [PATCH 01/15] vlc_common: add helper function to convert milliseconds to/from mtime_t

Steve Lhomme robux4 at ycbcr.xyz
Mon Jun 18 08:49:55 CEST 2018


On 2018-06-16 10:32 AM, Rémi Denis-Courmont wrote:
> Le perjantaina 15. kesäkuuta 2018, 18.09.12 EEST Steve Lhomme a écrit :
>> From: Rémi Denis-Courmont <remi at remlab.net>
>>
>> ---
>>   include/vlc_common.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/include/vlc_common.h b/include/vlc_common.h
>> index cc94b2f374e..cc2f39e84a5 100644
>> --- a/include/vlc_common.h
>> +++ b/include/vlc_common.h
>> @@ -288,6 +288,10 @@
>>    */
>>   typedef int64_t mtime_t;
>>
>> +#define VTICK_FROM_MILLI(ms) ((ms) * (CLOCK_FREQ / 1000))
>> +#define MILLI_FROM_VTICK(ms) (((ms) * 1000) / CLOCK_FREQ)
> Vtick sounds like virtual tick. We generally frown upon adding new prefixes
> given how C sucks as namespacing.

I welcome other propositions. VLC_TICK_FROM_MILLI is too long IMO, given 
we are still in the 80 columns world.


More information about the vlc-devel mailing list