[vlc-commits] direct3d11: don't use the flip module before Win8.1

Steve Lhomme git at videolan.org
Mon Oct 15 13:39:27 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct 15 13:07:30 2018 +0200| [b24b4116a96e4ddbfd9227218eb3ec089040bc3b] | committer: Steve Lhomme

direct3d11: don't use the flip module before Win8.1

It's supported but Win7 can still use the d3d11 output.

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d5c4f17fa7..19013eae60 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -504,7 +504,19 @@ static void FillSwapChainDesc(vout_display_t *vd, DXGI_SWAP_CHAIN_DESC1 *out)
     if (isWin10OrGreater)
         out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
     else
-        out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+    {
+        bool isWin81OrGreater = false;
+        HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+        if (likely(hKernel32 != NULL))
+            isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") != NULL;
+        if (isWin81OrGreater)
+            out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+        else
+        {
+            out->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
+            out->BufferCount = 1;
+        }
+    }
 }
 #endif
 



More information about the vlc-commits mailing list