vulkan_decode: ensure there's at least one context per decode thread

Otherwise, what may happen is that 2 threads will both write
into the same context.
This commit is contained in:
Lynne 2024-11-28 00:51:21 +09:00
parent a5e6860a89
commit 41f65b7326
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
1 changed files with 2 additions and 1 deletions

View File

@ -1159,7 +1159,8 @@ int ff_vk_decode_init(AVCodecContext *avctx)
/* Create decode exec context for this specific main thread.
* 2 async contexts per thread was experimentally determined to be optimal
* for a majority of streams. */
err = ff_vk_exec_pool_init(s, &ctx->qf, &dec->exec_pool, 2*ctx->qf.nb_queues,
err = ff_vk_exec_pool_init(s, &ctx->qf, &dec->exec_pool,
FFMAX(2*ctx->qf.nb_queues, avctx->thread_count),
nb_q, VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
profile);
if (err < 0)