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

Linjie Fu linjie.fu at intel.com
Tue Jan 21 10:41:06 EET 2020


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 at intel.com>
---
 libavfilter/vf_scale_qsv.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 
-- 
2.7.4



More information about the ffmpeg-devel mailing list