summaryrefslogtreecommitdiff
path: root/libavcodec/cuviddec.c
diff options
context:
space:
mode:
authorMichal Novotny <michal.novotny@comprimato.com>2021-02-19 14:33:25 -0800
committerTimo Rothenpieler <timo@rothenpieler.org>2021-02-22 16:54:28 +0100
commitb5d95998ffecafb20811604d36224f8b9dfdeefc (patch)
tree332e8057d3f408857e9d522c9cd5ff0deee0dea7 /libavcodec/cuviddec.c
parenta0949d0bcb0eee2f3fffcf9a4810c0295d14c0dc (diff)
avcodec/cuviddec: set ulMaxDisplayDelay to zero if low_delay flag is set
Zero is the recommended value in Nvidia coding samples for low latency use-cases. Signed-off-by: Michal Novotny <michal.novotny@comprimato.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/cuviddec.c')
-rw-r--r--libavcodec/cuviddec.c2
1 files changed, 1 insertions, 1 deletions
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;