lavc/ratecontrol: use AVCodecContext.framerate when available

pull/389/head
Anton Khirnov 2 years ago
parent e930b834a9
commit dc20baa049
  1. 3
      libavcodec/ratecontrol.c

@ -57,6 +57,9 @@ void ff_write_pass1_stats(MpegEncContext *s)
static double get_fps(AVCodecContext *avctx)
{
if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
return av_q2d(avctx->framerate);
return 1.0 / av_q2d(avctx->time_base) / FFMAX(avctx->ticks_per_frame, 1);
}

Loading…
Cancel
Save