summaryrefslogtreecommitdiff
path: root/libavcodec/nvdec.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2018-10-24 18:38:44 -0700
committerPhilip Langdale <philipl@overt.org>2018-11-02 11:27:13 -0700
commit1b41115ef70896d9b98ce842dc5f21c465396ce2 (patch)
tree444847e5189f6195d4bd2b182edd266fe1ebd512 /libavcodec/nvdec.c
parentd5272e94ab22bfc8f01fa3174e2c4664161ddf5a (diff)
downloadffmpeg-1b41115ef70896d9b98ce842dc5f21c465396ce2.tar.gz
avcodec/nvdec: Increase frame pool size to help deinterlacing
With the cuda yadif filter in use, the number of mapped decoder frames could increase by two, as the filter holds on to additional frames.
Diffstat (limited to 'libavcodec/nvdec.c')
-rw-r--r--libavcodec/nvdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c
index 4dd6b1acf3..0426c9b319 100644
--- a/libavcodec/nvdec.c
+++ b/libavcodec/nvdec.c
@@ -601,7 +601,11 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
frames_ctx->format = AV_PIX_FMT_CUDA;
frames_ctx->width = (avctx->coded_width + 1) & ~1;
frames_ctx->height = (avctx->coded_height + 1) & ~1;
- frames_ctx->initial_pool_size = dpb_size;
+ /*
+ * We add two extra frames to the pool to account for deinterlacing filters
+ * holding onto their frames.
+ */
+ frames_ctx->initial_pool_size = dpb_size + 2;
frames_ctx->free = nvdec_free_dummy;
frames_ctx->pool = av_buffer_pool_init(0, nvdec_alloc_dummy);