mirror of https://git.ffmpeg.org/ffmpeg.git
libavutil/hwcontext_cuda: don't destroy external context when using current CUDA context
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
parent
442d9412d2
commit
f904e60c32
|
@ -290,7 +290,7 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx)
|
||||||
if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
|
if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
|
||||||
if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
|
if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
|
||||||
CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
|
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));
|
CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
|
||||||
|
|
||||||
hwctx->cuda_ctx = NULL;
|
hwctx->cuda_ctx = NULL;
|
||||||
|
|
Loading…
Reference in New Issue