[vlc-devel] [PATCH] dxva2: log why the surface creation fails

Steve Lhomme robux4 at videolabs.io
Fri Jul 29 17:09:54 CEST 2016


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

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 936e1df..583a236 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -698,8 +698,9 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, const video_format_t
 
     vlc_va_sys_t *p_sys = va->sys;
     directx_sys_t *sys = &va->sys->dx_sys;
+    HRESULT hr;
 
-    if (FAILED(IDirectXVideoDecoderService_CreateSurface((IDirectXVideoDecoderService*) sys->d3ddec,
+    hr = IDirectXVideoDecoderService_CreateSurface((IDirectXVideoDecoderService*) sys->d3ddec,
                                                          sys->surface_width,
                                                          sys->surface_height,
                                                          sys->surface_count - 1,
@@ -708,8 +709,9 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, const video_format_t
                                                          0,
                                                          DXVA2_VideoDecoderRenderTarget,
                                                          (LPDIRECT3DSURFACE9*) sys->hw_surface,
-                                                         NULL))) {
-        msg_Err(va, "IDirectXVideoAccelerationService_CreateSurface failed");
+                                                         NULL);
+    if (FAILED(hr)) {
+        msg_Err(va, "IDirectXVideoAccelerationService_CreateSurface failed (hr=0x%0lx)", hr);
         sys->surface_count = 0;
         return VLC_EGENERIC;
     }
-- 
2.8.2



More information about the vlc-devel mailing list