[FFmpeg-cvslog] vulkan: only wait for fences on uninit if the context had a submission

Lynne git at videolan.org
Tue Nov 26 15:16:10 EET 2024


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Sun Nov 24 17:29:40 2024 +0100| [ce8a070cf39dd46e43cc91165740dad4acddcfdd] | committer: Lynne

vulkan: only wait for fences on uninit if the context had a submission

This fixes a potential deadlock on exit.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce8a070cf39dd46e43cc91165740dad4acddcfdd
---

 libavutil/vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index eaf73eb4fd..904d3a9a55 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -247,7 +247,8 @@ void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
         FFVkExecContext *e = &pool->contexts[i];
 
         if (e->fence) {
-            vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX);
+            if (e->had_submission)
+                vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX);
             vk->DestroyFence(s->hwctx->act_dev, e->fence, s->hwctx->alloc);
         }
         pthread_mutex_destroy(&e->lock);



More information about the ffmpeg-cvslog mailing list