[FFmpeg-devel] [PATCH 1/3] avutil/opt: Fix setting int64 to its maximum

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Nov 20 14:29:06 EET 2016


2016-11-20 12:57 GMT+01:00 Michael Niedermayer <michael at niedermayer.cc>:

> -    case AV_OPT_TYPE_INT64:
> -        *(int64_t *)dst = llrint(num / den) * intnum;
> -        break;
> +    case AV_OPT_TYPE_INT64:{
> +        double d = num / den;
> +        if (intnum == 1 && d == (double)INT64_MAX) *(int64_t *)dst = INT64_MAX;
> +        else                                       *(int64_t *)dst = llrint(d) * intnum;
> +        break;}

Feel free to ignore but I believe the patch gets more readable with
carriage returns before the brackets.
(They exist similarly in adpcm.c)

Carl Eugen


More information about the ffmpeg-devel mailing list