diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-02-12 22:56:12 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-02-12 22:56:12 +0000 |
commit | b668a1c8b35d7b45eb32cba465fb99b99355998c (patch) | |
tree | 235625a64c74b35ff282a73fb15333f6e16e5d94 /libavfilter/vf_hwmap.c | |
parent | 6e050e0085b3f6f1109a0593aad63ec6e6bf23ff (diff) | |
parent | c6bc18bc121ea66df715123c59f7ef9542c0914a (diff) |
Merge commit 'c6bc18bc121ea66df715123c59f7ef9542c0914a'
* commit 'c6bc18bc121ea66df715123c59f7ef9542c0914a':
vf_hwupload/hwmap: Support setting a fixed pool size
Merged-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavfilter/vf_hwmap.c')
-rw-r--r-- | libavfilter/vf_hwmap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c index d5fc3c46e6..290559a06a 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 " |