On Wed, Nov 10, 2021 at 08:46:26PM +0800, Zhao Zhili wrote: > Make get_int/set_int symetric. The int64_t to double to int64_t > conversion is unprecise for large value. > --- > libavutil/opt.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavutil/opt.c b/libavutil/opt.c > index c7001dbcd3..b2be63828d 100644 > --- a/libavutil/opt.c > +++ b/libavutil/opt.c > @@ -920,7 +920,10 @@ int av_opt_get_int(void *obj, const char *name, int > search_flags, int64_t *out_v > > if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, > search_flags)) < 0) > return ret; > - *out_val = num * intnum / den;
> + if (num / den == 1.0) this can be simplified to num == den [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".