diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-02-12 22:22:30 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-02-12 22:22:30 +0000 |
commit | 9471122a1b5dec34572c3d4c675737f0493d140e (patch) | |
tree | eb1347bfa0e2213822b1a432c0591be17ed29fd6 /libavcodec/decode.c | |
parent | d23fff0d8a0e7df170c67a9dd5c1f7c1fc0da489 (diff) | |
parent | cad739dace55e3446ef7180de688173cd19fb000 (diff) | |
download | ffmpeg-9471122a1b5dec34572c3d4c675737f0493d140e.tar.gz |
Merge commit 'cad739dace55e3446ef7180de688173cd19fb000'
* commit 'cad739dace55e3446ef7180de688173cd19fb000':
lavc: Add per-thread surfaces in get_hw_frame_parameters()
Merged-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index e984d9754e..522720c07a 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1186,10 +1186,6 @@ int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx, // We guarantee 4 base work surfaces. The function above guarantees 1 // (the absolute minimum), so add the missing count. frames_ctx->initial_pool_size += 3; - - // Add an additional surface per thread is frame threading is enabled. - if (avctx->active_thread_type & FF_THREAD_FRAME) - frames_ctx->initial_pool_size += avctx->thread_count; } ret = av_hwframe_ctx_init(avctx->hw_frames_ctx); @@ -1236,6 +1232,11 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, // available then add them here. if (avctx->extra_hw_frames > 0) frames_ctx->initial_pool_size += avctx->extra_hw_frames; + + // If frame threading is enabled then an extra surface per thread + // is also required. + if (avctx->active_thread_type & FF_THREAD_FRAME) + frames_ctx->initial_pool_size += avctx->thread_count; } *out_frames_ref = frames_ref; |