[FFmpeg-cvslog] Write aspect ratio when muxing gif.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Apr 3 08:13:54 CEST 2014


On 02.04.2014, at 22:53, git at videolan.org (Carl Eugen Hoyos) wrote:

> +    if (sar.num > 0 && sar.den > 0) {
> +        aspect = sar.num * 64 / sar.den - 15;
> +        if (aspect < 0 || aspect > 255)
> +            aspect = 0;
> +    }

Not a big deal, but have you considered clamping to 1..255 instead of setting to 0?
Because I find it a bit strange that like this 0.5 aspect would work, but 0.1 suddenly will look like no aspect again.
Also, strictly speaking I think there is no guarantee that sar.num * 64 does not overflow.
I think multiplying sar with (AVRational){64, 1} via the appropriate helper functions would avoid that.


More information about the ffmpeg-cvslog mailing list