diff mbox series

[FFmpeg-devel] lavfi/vf_scale_qsv: add extra_hw_frames support

Message ID 1579596066-24850-1-git-send-email-linjie.fu@intel.com
State New
Headers show
Series [FFmpeg-devel] lavfi/vf_scale_qsv: add extra_hw_frames support | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Fu, Linjie Jan. 21, 2020, 8:41 a.m. UTC
While using scale_qsv together with lookahead, extra_hw_frames is
required to allocate enough memory.

Fix #8379.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
---
 libavfilter/vf_scale_qsv.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c
index 1cf5367..784414a 100644
--- a/libavfilter/vf_scale_qsv.c
+++ b/libavfilter/vf_scale_qsv.c
@@ -205,6 +205,8 @@  static int init_out_pool(AVFilterContext *ctx,
     out_frames_ctx->height            = FFALIGN(out_height, 16);
     out_frames_ctx->sw_format         = out_format;
     out_frames_ctx->initial_pool_size = 4;
+    if (ctx->extra_hw_frames > 0)
+            out_frames_ctx->initial_pool_size += ctx->extra_hw_frames;
 
     out_frames_hwctx->frame_type = in_frames_hwctx->frame_type;