no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg.git.patch9
1 diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
2 index 718a449b6e..84685fe1d9 100644
3 --- a/libavutil/hwcontext_cuda.c
4 +++ b/libavutil/hwcontext_cuda.c
5 @@ -269,9 +269,11 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx)
6          CudaFunctions *cu = hwctx->internal->cuda_dl;
7  
8          if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
9 +#ifdef CUDA_PRIMARY_CTX
10              if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
11                  CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
12              else
13 +#endif
14                  CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
15  
16              hwctx->cuda_ctx = NULL;
17 @@ -321,7 +323,7 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) {
18      cu = hwctx->internal->cuda_dl;
19  
20      hwctx->internal->flags = flags;
21 -
22 +#ifdef CUDA_PRIMARY_CTX
23      if (flags & AV_CUDA_USE_PRIMARY_CONTEXT) {
24          ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device,
25                         &dev_flags, &dev_active));
26 @@ -342,7 +344,9 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) {
27                                                      hwctx->internal->cuda_device));
28          if (ret < 0)
29              return ret;
30 -    } else {
31 +    } else
32 +#endif
33 +    {
34          ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags,
35                                         hwctx->internal->cuda_device));
36          if (ret < 0)