[vlc-commits] codec: avcodec: handle low delay mode

Francois Cartegnie git at videolan.org
Thu Mar 7 17:29:32 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 28 14:28:42 2019 +0100| [4bfd2cf0156562abba5713c37dfdf1451d1d044b] | committer: Francois Cartegnie

codec: avcodec: handle low delay mode

Frame threading mode only creates high latency.
Speeds up by 6 frames duration on 60 fps mode (250->150ms)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4bfd2cf0156562abba5713c37dfdf1451d1d044b
---

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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 4f3c496c8a..26ecffcade 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -479,6 +479,12 @@ static int OpenVideoCodec( decoder_t *p_dec )
         ctx->flags |= AV_CODEC_FLAG_LOW_DELAY;
     }
 
+    if( var_InheritBool(p_dec, "low-delay") )
+    {
+        ctx->flags |= AV_CODEC_FLAG_LOW_DELAY;
+        ctx->active_thread_type = FF_THREAD_SLICE;
+    }
+
     post_mt( p_sys );
     ret = ffmpeg_OpenCodec( p_dec, ctx, codec );
     wait_mt( p_sys );



More information about the vlc-commits mailing list