On Mon, Oct 14, 2019 at 14:52:44 +0800, hwr...@126.com wrote:
> From: hwren <hwr...@126.com>
> +    float framerate;
[...]
> +    if (avctx->framerate.den > 0 && avctx->framerate.num > 0) {
> +        framerate = (float)avctx->framerate.num / 
> (float)avctx->framerate.den;
> +    }

It should suffice to cast only .den. See av_q2d(). Actually, since it's
only used in _init() anyway, you could use av_q2d() at the cost of
double versus float.

BTW, what value does framerate have if this if-clause isn't met?
Zero-initialized, right?

Cheers,
Moritz
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to