dxva2: fix DXVA2.DLL reference not increased when copying the picture context
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 11 Mar 2020 12:24:26 +0000 (13:24 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Thu, 12 Mar 2020 07:22:39 +0000 (08:22 +0100)
The DLL is referenced in another picture so also needs to be kept alive while
that picture is around.

modules/codec/avcodec/dxva2.c

index 75fb22b..3dda2c6 100644 (file)
@@ -178,6 +178,7 @@ static picture_context_t *dxva2_pic_context_copy(picture_context_t *ctx)
     if (unlikely(pic_ctx==NULL))
         return NULL;
     *pic_ctx = *src_ctx;
+    pic_ctx->dxva2_dll = LoadLibrary(TEXT("DXVA2.DLL"));
     vlc_video_context_Hold(pic_ctx->ctx.s.vctx);
     va_surface_AddRef(pic_ctx->va_surface);
     AcquireD3D9PictureSys(&pic_ctx->ctx.picsys);