d3d9: don't store the IDirect3DDevice9 in the d3d9 video context
authorSteve Lhomme <robux4@ycbcr.xyz>
Thu, 21 Nov 2019 10:16:03 +0000 (11:16 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Thu, 21 Nov 2019 12:25:19 +0000 (13:25 +0100)
It's already in the decoder device.

modules/codec/avcodec/dxva2.c
modules/video_chroma/d3d9_fmt.c
modules/video_chroma/d3d9_fmt.h

index 8180d93..7b42d6a 100644 (file)
@@ -272,9 +272,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
         free( sys );
         return VLC_EGENERIC;
     }
-    d3d9_video_context_t *octx = GetD3D9ContextPrivate(sys->vctx);
-    octx->dev = d3d9_decoder->d3ddev.dev;
-    IDirect3DDevice9_AddRef(octx->dev);
 
     va->sys = sys;
 
@@ -337,6 +334,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
                     DxgiVendorStr(d3dai.VendorId), d3dai.VendorId, d3dai.DeviceId, d3dai.Revision);
     }
 
+    d3d9_video_context_t *octx = GetD3D9ContextPrivate(sys->vctx);
     octx->format = sys->render;
 
     va->ops = &ops;
index 508bfc8..6cead89 100644 (file)
@@ -286,14 +286,8 @@ void D3D9_CloneExternal(d3d9_handle_t *hd3d, IDirect3D9 *dev)
         IDirect3D9Ex_Release((IDirect3D9Ex*) pv);
 }
 
-static void ReleaseD3D9ContextPrivate(void *private)
-{
-    d3d9_video_context_t *octx = private;
-    IDirect3DDevice9_Release(octx->dev);
-}
-
 const struct vlc_video_context_operations d3d9_vctx_ops = {
-    ReleaseD3D9ContextPrivate,
+    NULL,
 };
 
 void d3d9_pic_context_destroy(picture_context_t *ctx)
index 23c75f6..d91f1a2 100644 (file)
@@ -78,7 +78,6 @@ typedef struct
 
 typedef struct
 {
-    IDirect3DDevice9 *dev;
     D3DFORMAT        format;
 } d3d9_video_context_t;