[vlc-commits] directx_va: do the d3ddec release in pf_destroy_video_service()

Steve Lhomme git at videolan.org
Thu Jun 22 17:26:22 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Fri Jun  2 11:11:03 2017 +0200| [dd3b5b8ee6946ff164f6690c87bea8f94814a241] | committer: Jean-Baptiste Kempf

directx_va: do the d3ddec release in pf_destroy_video_service()

And make the release strongly typed

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/d3d11va.c    | 4 +++-
 modules/codec/avcodec/directx_va.c | 2 --
 modules/codec/avcodec/dxva2.c      | 3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index e049773bc9..909fc01927 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -610,7 +610,9 @@ static int DxCreateVideoService(vlc_va_t *va)
  */
 static void DxDestroyVideoService(vlc_va_t *va)
 {
-    VLC_UNUSED(va);
+    directx_sys_t *dx_sys = &va->sys->dx_sys;
+    if (dx_sys->d3ddec)
+        ID3D11VideoDevice_Release(dx_sys->d3ddec);
 }
 
 static void ReleaseInputList(input_list_t *p_list)
diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 90c85d8499..f98a91e4cd 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -433,8 +433,6 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
 {
     DestroyVideoDecoder(va, dx_sys);
     dx_sys->pf_destroy_video_service(va);
-    if (dx_sys->d3ddec)
-        IUnknown_Release(dx_sys->d3ddec);
     if (dx_sys->pf_destroy_device_manager)
         dx_sys->pf_destroy_device_manager(va);
     dx_sys->pf_destroy_device(va);
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 10a8608b45..61d35ea555 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -562,8 +562,11 @@ static int DxCreateVideoService(vlc_va_t *va)
  */
 static void DxDestroyVideoService(vlc_va_t *va)
 {
+    directx_sys_t *dx_sys = &va->sys->dx_sys;
     if (va->sys->device)
         IDirect3DDeviceManager9_CloseDeviceHandle(va->sys->devmng, va->sys->device);
+    if (dx_sys->d3ddec)
+        IDirectXVideoDecoderService_Release(dx_sys->d3ddec);
 }
 
 static void ReleaseInputList(input_list_t *p_list)



More information about the vlc-commits mailing list