[vlc-commits] dxva2: warn when closing the device handle failed

Steve Lhomme git at videolan.org
Thu Oct 5 14:33:28 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Fri Sep 29 14:45:26 2017 +0200| [c63c6b53148cb34c76a1b78807d32bac12ee7549] | committer: Jean-Baptiste Kempf

dxva2: warn when closing the device handle failed

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

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

 modules/codec/avcodec/dxva2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index c5e829bdf2..e409aa591f 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -517,7 +517,11 @@ 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);
+    {
+        HRESULT hr = IDirect3DDeviceManager9_CloseDeviceHandle(va->sys->devmng, va->sys->device);
+        if (FAILED(hr))
+            msg_Warn(va, "Failed to release device handle %x. (hr=0x%lX)", va->sys->device, hr);
+    }
     if (dx_sys->d3ddec)
         IDirectXVideoDecoderService_Release(dx_sys->d3ddec);
 }



More information about the vlc-commits mailing list