[vlc-commits] dxva2: clean device checking when getting the decoder surface

Steve Lhomme git at videolan.org
Tue Jan 8 11:39:03 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan  8 11:29:32 2019 +0100| [381aac91b86a87ff74b4be3be7c34c6f02685ab4] | committer: Steve Lhomme

dxva2: clean device checking when getting the decoder surface

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

 modules/codec/avcodec/dxva2.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 9569990841..3a732b551f 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -149,7 +149,6 @@ static int DxSetupOutput(vlc_va_t *, const GUID *, const video_format_t *);
 static int DxCreateVideoDecoder(vlc_va_t *, int codec_id,
                                 const video_format_t *, unsigned surface_count);
 static void DxDestroyVideoDecoder(vlc_va_t *);
-static int DxResetVideoDecoder(vlc_va_t *);
 static void SetupAVCodecContext(vlc_va_t *);
 
 void SetupAVCodecContext(vlc_va_t *va)
@@ -222,12 +221,11 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
 
     /* Check the device */
     HRESULT hr = IDirect3DDeviceManager9_TestDevice(sys->devmng, sys->device);
-    if (hr == DXVA2_E_NEW_VIDEO_DEVICE) {
-        msg_Warn(va, "New video device detected.");
-        if (DxResetVideoDecoder(va))
-            return VLC_EGENERIC;
-    } else if (FAILED(hr)) {
-        msg_Err(va, "IDirect3DDeviceManager9_TestDevice %u", (unsigned)hr);
+    if (FAILED(hr)) {
+        if (hr == DXVA2_E_NEW_VIDEO_DEVICE)
+            msg_Warn(va, "New video device detected.");
+        else
+            msg_Err(va, "device not usable. (hr=0x%lX)", hr);
         return VLC_EGENERIC;
     }
 
@@ -730,9 +728,3 @@ static void DxDestroyVideoDecoder(vlc_va_t *va)
             IDirect3DSurface9_Release(dx_sys->hw_surface[i]);
     }
 }
-
-static int DxResetVideoDecoder(vlc_va_t *va)
-{
-    msg_Err(va, "DxResetVideoDecoder unimplemented");
-    return VLC_EGENERIC;
-}



More information about the vlc-commits mailing list