Commit f904e60c authored by Roman Arzumanyan's avatar Roman Arzumanyan Committed by Timo Rothenpieler

libavutil/hwcontext_cuda: don't destroy external context when using current CUDA context

Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent 442d9412
......@@ -290,7 +290,7 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx)
if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
else
else if (!(hwctx->internal->flags & AV_CUDA_USE_CURRENT_CONTEXT))
CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
hwctx->cuda_ctx = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment