[vlc-commits] d3d9: don't store the IDirect3DDevice9 in the d3d9 video context

Steve Lhomme git at videolan.org
Thu Nov 21 13:51:23 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Nov 21 11:16:03 2019 +0100| [4182b3112d4ecd8e0149b00b3dec837550616c10] | committer: Steve Lhomme

d3d9: don't store the IDirect3DDevice9 in the d3d9 video context

It's already in the decoder device.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4182b3112d4ecd8e0149b00b3dec837550616c10
---

 modules/codec/avcodec/dxva2.c   | 4 +---
 modules/video_chroma/d3d9_fmt.c | 8 +-------
 modules/video_chroma/d3d9_fmt.h | 1 -
 3 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 8180d9373a..7b42d6a663 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -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;
diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index 508bfc838f..6cead89856 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -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)
diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index 23c75f669f..d91f1a223b 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -78,7 +78,6 @@ typedef struct
 
 typedef struct
 {
-    IDirect3DDevice9 *dev;
     D3DFORMAT        format;
 } d3d9_video_context_t;
 



More information about the vlc-commits mailing list