Commit 9fd2b394 authored by Zhao Zhili's avatar Zhao Zhili Committed by 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 44c65c6c
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment