[vlc-commits] direct3d11: check more return values

Steve Lhomme git at videolan.org
Wed Jun 17 14:21:19 CEST 2015


vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Wed Jun 17 12:20:51 2015 +0200| [7fb0374f0ee2e0d78262dc0d19568b9836c428b6] | committer: Jean-Baptiste Kempf

direct3d11: check more return values

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

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

 modules/video_output/msw/direct3d11.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index e7b321b..1f3e698 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -648,6 +648,10 @@ static HRESULT UpdateBackBuffer(vout_display_t *vd)
 
     hr = ID3D11Device_CreateRenderTargetView(sys->d3ddevice, (ID3D11Resource *)pBackBuffer, NULL, &sys->d3drenderTargetView);
     ID3D11Texture2D_Release(pBackBuffer);
+    if (FAILED(hr)) {
+        msg_Err(vd, "Failed to create the target view. (hr=0x%lX)", hr);
+        return hr;
+    }
 
     D3D11_TEXTURE2D_DESC deptTexDesc;
     memset(&deptTexDesc, 0,sizeof(deptTexDesc));
@@ -785,7 +789,11 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
         }
     }
 
-    IDXGISwapChain_Present(sys->dxgiswapChain, 0, 0);
+    HRESULT hr = IDXGISwapChain_Present(sys->dxgiswapChain, 0, 0);
+    if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
+    {
+        /* TODO device lost */
+    }
 
     picture_Release(picture);
     if (subpicture)



More information about the vlc-commits mailing list