[FFmpeg-devel] [PATCH] use proper macro to avoid issue with prior avutil/timestamp.c

Hendrik Leppkes h.leppkes at gmail.com
Sat Aug 17 18:29:31 EEST 2024


On Sat, Aug 17, 2024 at 3:27 PM Mike Lieman <mikelieman at gmail.com> wrote:
>
> >
> > FP_INFINITE is a return value from fpclassify(), not a double.
> >
> > Does maybe using av_int2double(UINT64_C(0xFFF) << 52) help your slow
> > startup?
> >
>
> Sadly, no.
>
> double log = (fpclassify(val) == FP_ZERO ? av_int2double(UINT64_C(0xFFF) <<
> 52) : floor(log10(fabs(val))));
>

For the logic in this particular function - even if not accurate, any
non-negative value will result in the same outcome as using -INFINITY.
So using even the value 0 would work.

My simple guess would be that the infinity check fails for some reason
(maybe -ffast-math?), thus treating the infinite as a finite value,
and using an extreme amount of precision that almost breaks printf?
We could avoid the infinity entirely here without any downsides, really.

Or you could check if your build uses ffast-math, not sure we support that.

- Hendrik


More information about the ffmpeg-devel mailing list