vlc/vlc-3.0 | branch: master | Francois Cartegnie <[email protected]> | Wed Jul 
25 22:10:36 2018 +0200| [3dd68ecf51d28cf6e14b22c5af67735bbc2c0330] | committer: 
Jean-Baptiste Kempf

codec: avcodec: set low delay on low fps

fixes non frame output with low fps videos

refs #20740

(cherry picked from commit c50cc26697eb92af03d73bd8e1a52c47bc6c3802)
Signed-off-by: Jean-Baptiste Kempf <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3dd68ecf51d28cf6e14b22c5af67735bbc2c0330
---

 modules/codec/avcodec/video.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 3bdbd46a93..12d824770e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -420,6 +420,13 @@ static int OpenVideoCodec( decoder_t *p_dec )
     cc_Init( &p_sys->cc );
 
     set_video_color_settings( &p_dec->fmt_in.video, ctx );
+    if( p_dec->fmt_in.video.i_frame_rate_base &&
+        p_dec->fmt_in.video.i_frame_rate &&
+        (double) p_dec->fmt_in.video.i_frame_rate /
+                 p_dec->fmt_in.video.i_frame_rate_base < 6 )
+    {
+        ctx->flags |= AV_CODEC_FLAG_LOW_DELAY;
+    }
 
     post_mt( p_sys );
     ret = ffmpeg_OpenCodec( p_dec, ctx, codec );

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to