mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/vf_idet: fix rounding of av_dict_set_fxp()
fixes the remainder overflowing beyond .999 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
fe6f5f2908
commit
5d590d87b3
@ -62,8 +62,13 @@ static int av_dict_set_fxp(AVDictionary **pm, const char *key, uint64_t value, u
|
||||
int flags)
|
||||
{
|
||||
char valuestr[44];
|
||||
uint64_t print_precision = uintpow(10, digits);
|
||||
|
||||
value = av_rescale(value, print_precision, PRECISION);
|
||||
|
||||
snprintf(valuestr, sizeof(valuestr), "%"PRId64".%0*"PRId64,
|
||||
value / PRECISION, digits, ( value % PRECISION ) / ( PRECISION / uintpow(10,digits) ));
|
||||
value / print_precision, digits, value % print_precision);
|
||||
|
||||
return av_dict_set(pm, key, valuestr, flags);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user