summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_cuda.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/hwdec_cuda.c')
-rw-r--r--video/out/opengl/hwdec_cuda.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/video/out/opengl/hwdec_cuda.c b/video/out/opengl/hwdec_cuda.c
index 4dc842706c..266714a972 100644
--- a/video/out/opengl/hwdec_cuda.c
+++ b/video/out/opengl/hwdec_cuda.c
@@ -28,13 +28,13 @@
*/
#include <libavutil/hwcontext.h>
-#include <libavutil/hwcontext_cuda.h>
+#include "cuda_dynamic.h"
#include "video/mp_image_pool.h"
#include "hwdec.h"
#include "video.h"
-#include <cudaGL.h>
+#include <libavutil/hwcontext_cuda.h>
struct priv {
struct mp_hwdec_ctx hwctx;
@@ -152,6 +152,11 @@ static int cuda_create(struct gl_hwdec *hw)
struct priv *p = talloc_zero(hw, struct priv);
hw->priv = p;
+ bool loaded = cuda_load();
+ if (!loaded) {
+ MP_ERR(hw, "Failed to load CUDA symbols\n");
+ }
+
ret = CHECK_CU(cuInit(0));
if (ret < 0)
goto error;
@@ -277,6 +282,8 @@ static void destroy(struct gl_hwdec *hw)
}
CHECK_CU(cuCtxPopCurrent(&dummy));
+ CHECK_CU(cuCtxDestroy(p->cuda_ctx));
+
gl->DeleteTextures(2, p->gl_textures);
hwdec_devices_remove(hw->devs, &p->hwctx);