update with-git-ffmpeg patches
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg.git.patch9
1 --- a/libavutil/hwcontext_cuda.c        2019-12-03 10:04:24.521156775 -0700
2 +++ b/libavutil/hwcontext_cuda.c        2019-12-03 10:59:03.924121027 -0700
3 @@ -282,9 +282,11 @@
4          CudaFunctions *cu = hwctx->internal->cuda_dl;
5  
6          if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
7 +#ifdef CUDA_PRIMARY_CTX
8              if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
9                  CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
10              else
11 +#endif
12                  CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
13  
14              hwctx->cuda_ctx = NULL;
15 @@ -351,7 +353,7 @@
16          goto error;
17  
18      hwctx->internal->flags = flags;
19 -
20 +#ifdef CUDA_PRIMARY_CTX
21      if (flags & AV_CUDA_USE_PRIMARY_CONTEXT) {
22          ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device, &dev_flags, &dev_active));
23          if (ret < 0)
24 @@ -369,7 +371,10 @@
25          ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx, hwctx->internal->cuda_device));
26          if (ret < 0)
27              goto error;
28 -    } else {
29 +    }
30 +    else
31 +#endif
32 +    {
33          ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device));
34          if (ret < 0)
35              goto error;