---
libavfilter/vf_deinterlace_vaapi.c | 5 +----
libavfilter/vf_scale_vaapi.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/libavfilter/vf_deinterlace_vaapi.c
b/libavfilter/vf_deinterlace_vaapi.c
index ab2a43291..1639d830e 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -293,10 +293,7 @@ static int deint_vaapi_config_output(AVFilterLink *outlink)
ctx->output_frames->width = ctx->output_width;
ctx->output_frames->height = ctx->output_height;
- // The number of output frames we need is determined by what follows
- // the filter. If it's an encoder with complex frame reference
- // structures then this could be very high.
- ctx->output_frames->initial_pool_size = 10;
+ ctx->output_frames->initial_pool_size = 4 + avctx->extra_hw_frames;
err = av_hwframe_ctx_init(ctx->output_frames_ref);
if (err < 0) {
diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 50be68eee..8fad41264 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -191,10 +191,7 @@ static int scale_vaapi_config_output(AVFilterLink *outlink)
ctx->output_frames->width = ctx->output_width;
ctx->output_frames->height = ctx->output_height;
- // The number of output frames we need is determined by what follows
- // the filter. If it's an encoder with complex frame reference
- // structures then this could be very high.
- ctx->output_frames->initial_pool_size = 10;
+ ctx->output_frames->initial_pool_size = 4 + avctx->extra_hw_frames;
err = av_hwframe_ctx_init(ctx->output_frames_ref);
if (err < 0) {
--
2.11.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel