[vlc-devel] [PATCH 06/15] vlc_common: add helper fonctions to convert from mtime_t to floating point seconds

Steve Lhomme robux4 at ycbcr.xyz
Sat Jun 16 10:44:05 CEST 2018

On 2018-06-16 10:27 AM, Rémi Denis-Courmont wrote:
> Le lauantaina 16. kesäkuuta 2018, 10.37.13 EEST Steve Lhomme a écrit :
>> In many case where it's used it's not obvious the output is requested in
>> float rather than int. Like sout << secf_from_vtick()
> And? Type selection is done by the input, not the output.

So we could have vtick_from_sec() with auto selection (seems to cover 
all the cases I found) but need separate sec(f)_from_vtick() ?

It found 3 cases where the conversion to floating point is not obvious:


>> Also the rounding may not be the same. For floating point llround() is
>> used in a few places. For integer it may be different although
>> everything I saw implied rounding down.
> If you care about rounding, you cannot use those macros or functions anyway.
> The use case will need to convert manually as fits.

More information about the vlc-devel mailing list