[vlc-devel] [RFC PATCH 01/13] clock: add vlc_clock
Denis Charmet
typx at dinauz.org
Fri Aug 31 11:59:56 CEST 2018
Hi,
On 2018-08-29 11:10, Zhao Zhili wrote:
> On 2018年06月27日 20:41, Thomas Guillem wrote:
>> +static vlc_tick_t main_stream_to_system(vlc_clock_main_t *
>> main_clock,
>> + vlc_tick_t pts)
>> +{
>> + if (unlikely(main_clock->offset == VLC_TS_INVALID))
>> + return VLC_TS_INVALID;
>> + return (vlc_tick_t) (pts * main_clock->coeff / main_clock->rate
>> + main_clock->offset);
>> +}
>
> I'm afraid int64_t to float to int64_t won't work well as float can
> only represent a small integer precisely.
> main_clock->offset makes it worse since it isn't uncommon to be a
> large value.
>
> (vlc_tick_t)(pts * main_clock->coeff / main_clock->rate) +
> main_clock->offset
>
> may be a little better, but the problem is still there.
>
Thanks for the review, it's indeed a very interesting point. It seems
that switching to double might help a lot with that. Any other
suggestions?
Regards,
--
Denis Charmet - TypX
Le mauvais esprit est un art de vivre
More information about the vlc-devel
mailing list