avcodec/v4l2_m2m: fix setting frame period
authorMing Qian <ming.qian@nxp.com>
Tue, 17 Mar 2020 11:29:23 +0000 (19:29 +0800)
committerAndriy Gelman <andriy.gelman@gmail.com>
Tue, 31 Mar 2020 21:24:42 +0000 (17:24 -0400)
Currently the driver's frame period is incorrectly set to the frame
rate. This is fixed in the commit.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
libavcodec/v4l2_m2m_enc.c

index c9f1741..84de63e 100644 (file)
@@ -172,7 +172,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
      * settingss
      */
     if (avctx->framerate.num || avctx->framerate.den)
-        v4l2_set_timeperframe(s, avctx->framerate.num, avctx->framerate.den);
+        v4l2_set_timeperframe(s, avctx->framerate.den, avctx->framerate.num);
 
     /* set ext ctrls */
     v4l2_set_ext_ctrl(s, MPEG_CID(HEADER_MODE), MPEG_VIDEO(HEADER_MODE_SEPARATE), "header mode");