[vlc-devel] [RFC 2/2] variables: Reduce InheritURational precision

Rémi Denis-Courmont remi at remlab.net
Tue Mar 29 15:00:10 CEST 2016

Le 2016-03-28 14:28, Hugo Beauzée-Luyssen a écrit :
> For instance, with 29.97, it yields num=1005626327 and den=33554432
> These numbers are then likely to be used for a date computation, 
> which
> again, during my tests, ends up overflowing the destination int64.

In other words, you are adding a bug to work around another bug. No 

> By reducing the precision, the results are more sensible (29.97 
> yields
> 30689/1024, which is much closer to the expected 30000/1001)

You could get 2997/100 if you parsed the decimal representation without 
an intermediate binary coding. But even then, that's not quite 
30000/1001 and you will get long term drift.

> This is probably not the best fix, and the correct solution would be 
> to
> provide the FPS as a fraction to begin with,


Rémi Denis-Courmont

More information about the vlc-devel mailing list