diff mbox series

[FFmpeg-devel] set ulMaxDisplayDelay cuviddec parser option to zero if low_delay flag is on

Message ID 20210222180546.136572-1-clime7@gmail.com
State New
Headers show
Series [FFmpeg-devel] set ulMaxDisplayDelay cuviddec parser option to zero if low_delay flag is on
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

clime Feb. 22, 2021, 6:05 p.m. UTC
From: Michal Novotny <michal.novotny@comprimato.com>

* zero is recommended value in Nvidia coding samples for low latency use-cases

Signed-off-by: Michal Novotny <michal.novotny@comprimato.com>
---
 libavcodec/cuviddec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 49775b5a09..ec57afdefe 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -999,7 +999,7 @@  static av_cold int cuvid_decode_init(AVCodecContext *avctx)
     }
 
     ctx->cuparseinfo.ulMaxNumDecodeSurfaces = ctx->nb_surfaces;
-    ctx->cuparseinfo.ulMaxDisplayDelay = 4;
+    ctx->cuparseinfo.ulMaxDisplayDelay = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 0 : 4;
     ctx->cuparseinfo.pUserData = avctx;
     ctx->cuparseinfo.pfnSequenceCallback = cuvid_handle_video_sequence;
     ctx->cuparseinfo.pfnDecodePicture = cuvid_handle_picture_decode;