diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-02-13 01:19:38 +0300 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-02-13 01:19:38 +0300 |
commit | d23fff0d8a0e7df170c67a9dd5c1f7c1fc0da489 (patch) | |
tree | 3b51fe6fabeae2eea7cd5027f58c01d965bb5d45 /libavcodec/decode.c | |
parent | d401ba6b3d86091dff2fae326c610f0120ee8853 (diff) | |
parent | 5b145290df2998a9836a93eb925289c6c8b63af0 (diff) |
Merge commit '5b145290df2998a9836a93eb925289c6c8b63af0'
* commit '5b145290df2998a9836a93eb925289c6c8b63af0':
lavc: Add support for increasing hardware frame pool sizes
Merged-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index f67b214759..e984d9754e 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1229,6 +1229,15 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, ret = hwa->frame_params(avctx, frames_ref); if (ret >= 0) { + AVHWFramesContext *frames_ctx = (AVHWFramesContext*)frames_ref->data; + + if (frames_ctx->initial_pool_size) { + // If the user has requested that extra output surfaces be + // available then add them here. + if (avctx->extra_hw_frames > 0) + frames_ctx->initial_pool_size += avctx->extra_hw_frames; + } + *out_frames_ref = frames_ref; } else { av_buffer_unref(&frames_ref); |