[FFmpeg-devel] [PATCH v3 4/4] lavc/libxavs2: replace 'FrameRate' with 'fps'

Moritz Barsnick barsnick at gmx.net
Mon Oct 14 14:22:38 EEST 2019


On Mon, Oct 14, 2019 at 14:52:44 +0800, hwrenx at 126.com wrote:
> From: hwren <hwrenx at 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


More information about the ffmpeg-devel mailing list