ffmpeg | branch: master | Zhao Zhili <[email protected]> | Wed Nov 10 23:36:15 2021 +0800| [9fd2b39428165c2319106e82a3c1ca1bba11aa54] | committer: Michael Niedermayer
avutil/opt: handle whole range of int64_t in av_opt_get_int Make get_int/set_int symetric. The int64_t to double to int64_t conversion is unprecise for large value. Signed-off-by: Michael Niedermayer <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fd2b39428165c2319106e82a3c1ca1bba11aa54 --- libavutil/opt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index c7001dbcd3..cfda31ea2f 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) + *out_val = intnum; + else + *out_val = num * intnum / den; return 0; } _______________________________________________ ffmpeg-cvslog mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
