X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_hwmap.c;h=290559a06ab9fb06ef325c80b956e575c1cdb510;hb=ae7e66fb4b1a256fb79a016b9c585de84ac77339;hp=d5fc3c46e626396db23296dbf4f2f38398840f01;hpb=d204b7ff610cb8dac1116e7a4fd3068733cb5adf;p=ffmpeg diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c index d5fc3c46e62..290559a06ab 100644 --- a/libavfilter/vf_hwmap.c +++ b/libavfilter/vf_hwmap.c @@ -143,7 +143,9 @@ static int hwmap_config_output(AVFilterLink *outlink) frames->sw_format = hwfc->sw_format; frames->width = hwfc->width; frames->height = hwfc->height; - frames->initial_pool_size = 64; + + if (avctx->extra_hw_frames >= 0) + frames->initial_pool_size = 2 + avctx->extra_hw_frames; err = av_hwframe_ctx_init(ctx->hwframes_ref); if (err < 0) { @@ -223,6 +225,9 @@ static int hwmap_config_output(AVFilterLink *outlink) hwfc->width = inlink->w; hwfc->height = inlink->h; + if (avctx->extra_hw_frames >= 0) + hwfc->initial_pool_size = 2 + avctx->extra_hw_frames; + err = av_hwframe_ctx_init(ctx->hwframes_ref); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to create frame "