[vlc-commits] direct3d11: only log the display capabilities

Steve Lhomme git at videolan.org
Thu May 9 15:31:16 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Apr 19 11:23:28 2019 +0200| [d9ffb3b28322b55c3487d063f7b24c2837243eb3] | committer: Steve Lhomme

direct3d11: only log the display capabilities

This call is called for every Resize (output update) so it's better not to
flood the logs in this case.

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

 modules/video_output/win32/direct3d11.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index cbaf66e64c..1fc16e9fe3 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -116,6 +116,8 @@ struct d3d11_local_swapchain
     IDXGISwapChain4        *dxgiswapChain4;  /* DXGI 1.5 for HDR metadata */
 
     ID3D11RenderTargetView *swapchainTargetView[D3D11_MAX_RENDER_TARGET];
+
+    bool                   logged_capabilities;
 };
 
 struct vout_display_sys_t
@@ -461,6 +463,7 @@ static bool UpdateSwapchain( struct d3d11_local_swapchain *display, const struct
         // the pixel format changed, we need a new swapchain
         IDXGISwapChain_Release(display->dxgiswapChain);
         display->dxgiswapChain = NULL;
+        display->logged_capabilities = false;
     }
 
     if ( display->dxgiswapChain == NULL )
@@ -1180,7 +1183,8 @@ static void SelectSwapchainColorspace(struct d3d11_local_swapchain *display, con
     {
         hr = IDXGISwapChain3_CheckColorSpaceSupport(dxgiswapChain3, color_spaces[i].dxgi, &support);
         if (SUCCEEDED(hr) && support) {
-            msg_Dbg(display->obj, "supports colorspace %s", color_spaces[i].name);
+            if (!display->logged_capabilities)
+                msg_Dbg(display->obj, "supports colorspace %s", color_spaces[i].name);
             score = 0;
             if (color_spaces[i].primaries == cfg->primaries)
                 score++;
@@ -1198,6 +1202,7 @@ static void SelectSwapchainColorspace(struct d3d11_local_swapchain *display, con
             }
         }
     }
+    display->logged_capabilities = true;
 
     if (best == -1)
     {



More information about the vlc-commits mailing list