diff --git a/video.c b/video.c index 875b03b..93a4385 100644 --- a/video.c +++ b/video.c @@ -1765,6 +1765,7 @@ static void CuvidDestroySurfaces(CuvidDecoder * decoder) GlxCheck(); if (decoder->cuda_ctx) { + checkCudaErrors(cuCtxPushCurrent(decoder->cuda_ctx)); for (i=0;iSurfacesNeeded;i++) { for (j=0;j<2;j++) { if (decoder->cu_res[i][j]) { @@ -1773,6 +1774,7 @@ static void CuvidDestroySurfaces(CuvidDecoder * decoder) } } } + checkCudaErrors(cuCtxPopCurrent(NULL)); }