[vlc-devel] [vlc-commits] commit: mtime: Avoid overflow when using mach_absolute_time(). (Pierre d' Herbemont )

Pierre d'Herbemont pdherbemont at free.fr
Sun Sep 26 13:29:27 CEST 2010


2010/9/26 Rémi Denis-Courmont <remi at remlab.net>:
>   Hello,
>
> On Sunday 26 September 2010, git at videolan.org wrote:
>> vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Aug
>> 1 12:48:49 2010 +0200| [532b014ad9c53a3ef32a74373fdb895726bde516] |
>> committer: Pierre d'Herbemont
>>
>> mtime: Avoid overflow when using mach_absolute_time().
>>
>> Switch to double, do the operations and then convert back.
>> This fixes the iPad video freezes.
>
> Double precision operations are probably awfully slow on iPad. I am not aware
> of any ARM core that supports doubles in hardware. This may be neglectible
> because ARM does not support integer division (by a non-constant or non-power
> of two divisor) either. Still, double has less precision than int64_t so this
> seems like a regression to me.
>
> Why don't you use the same (integer) strategy as the Win32 code already does?

Nice point. I'll switch to 64bit integer and manually check the upper
bit overflow.

Thanks.

Pierre.



More information about the vlc-devel mailing list