[vlc-commits] direct3d9: use a version check with a better name to disable D3D9

Steve Lhomme git at videolan.org
Tue Aug 7 09:13:02 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 31 15:15:48 2018 +0200| [038e853c0357c61e97d688aee53193de3c1ed8d6] | committer: Steve Lhomme

direct3d9: use a version check with a better name to disable D3D9

The VersionHelpers API is available since Win2000

(cherry picked from commit c0abd168d4e9c4d9f60112105da8b9ff5f1df74b)

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

 modules/video_output/win32/direct3d9.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index d60e92e7ed..f3d7773f00 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -56,6 +56,7 @@
 #include "builtin_shaders.h"
 
 #include <assert.h>
+#include <versionhelpers.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -251,9 +252,8 @@ static int Open(vlc_object_t *object)
     if ( !vd->obj.force && vd->source.mastering.max_luminance != 0)
         return VLC_EGENERIC; /* let a module who can handle it do it */
 
-    OSVERSIONINFO winVer;
-    winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-    if(GetVersionEx(&winVer) && winVer.dwMajorVersion < 6 && !object->obj.force)
+    /* do not use D3D9 on XP unless forced */
+    if(!object->obj.force && !IsWindowsVistaOrGreater())
         return VLC_EGENERIC;
 
     /* Allocate structure */



More information about the vlc-commits mailing list