summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vulkan.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-11-13 00:14:10 +0100
committerLynne <dev@lynne.ee>2021-11-13 00:32:53 +0100
commit015b487777cc3bd540f7d77e7ce902a3ab4a7239 (patch)
tree62ba40132ddfd0e891aa15ac71f45cf1681b905c /libavutil/hwcontext_vulkan.c
parentfa28c1b2f9d6fa9e3c0e89c27ad9a55add3a620f (diff)
hwcontext_vulkan: do not dup() semaphore FDs for CUDA
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r--libavutil/hwcontext_vulkan.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 4ab8a3f6ad..0dbbb9d12f 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -123,7 +123,6 @@ typedef struct AVVkFrameInternal {
CUmipmappedArray cu_mma[AV_NUM_DATA_POINTERS];
CUarray cu_array[AV_NUM_DATA_POINTERS];
CUexternalSemaphore cu_sem[AV_NUM_DATA_POINTERS];
- int exp_sem[AV_NUM_DATA_POINTERS];
#endif
} AVVkFrameInternal;
@@ -1572,7 +1571,6 @@ static void vulkan_free_internal(AVVkFrameInternal *internal)
CHECK_CU(cu->cuMipmappedArrayDestroy(internal->cu_mma[i]));
if (internal->ext_mem[i])
CHECK_CU(cu->cuDestroyExternalMemory(internal->ext_mem[i]));
- close(internal->exp_sem[i]);
}
av_buffer_unref(&internal->cuda_fc_ref);
@@ -2698,7 +2696,7 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
}
ret = vk->GetSemaphoreFdKHR(hwctx->act_dev, &sem_export,
- &dst_int->exp_sem[i]);
+ &ext_sem_desc.handle.fd);
if (ret != VK_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "Failed to export semaphore: %s\n",
vk_ret2str(ret));
@@ -2706,8 +2704,6 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
goto fail;
}
- ext_sem_desc.handle.fd = dup(dst_int->exp_sem[i]);
-
ret = CHECK_CU(cu->cuImportExternalSemaphore(&dst_int->cu_sem[i],
&ext_sem_desc));
if (ret < 0) {