dxva2: warn when closing the device handle failed
authorSteve Lhomme <robux4@gmail.com>
Fri, 29 Sep 2017 12:45:26 +0000 (14:45 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Oct 2017 12:33:19 +0000 (14:33 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/avcodec/dxva2.c

index c5e829b..e409aa5 100644 (file)
@@ -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);
 }