[vlc-commits] vout:directd9: don't compile shaders if the headers are not available

Steve Lhomme git at videolan.org
Thu Jun 29 14:22:38 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Mon Jun 12 09:47:39 2017 +0200| [e7d9db4ef2282434cf4340e8f06632137ed0dac0] | committer: Jean-Baptiste Kempf

vout:directd9: don't compile shaders if the headers are not available

It's not found in MS headers anymore, only the old DirectX SDK from 2010.

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

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

 configure.ac                           | 1 +
 modules/video_output/win32/direct3d9.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 67fc7deb1a..5ba330845c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3291,6 +3291,7 @@ AS_IF([test "${enable_directx}" != "no"], [
   dnl Direct3D9
   AC_CHECK_HEADERS(d3d9.h, [
     VLC_ADD_PLUGIN([direct3d9])
+    AC_CHECK_HEADERS(d3dx9effect.h)
 
     AC_CHECK_FUNCS([IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids],
       [
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 952c44e42d..1d281b3116 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -47,7 +47,9 @@
 
 #include <windows.h>
 #include <d3d9.h>
+#ifdef HAVE_D3DX9EFFECT_H
 #include <d3dx9effect.h>
+#endif
 #include "../../video_chroma/d3d9_fmt.h"
 
 #include "common.h"
@@ -1293,6 +1295,7 @@ static void Direct3D9DestroyScene(vout_display_t *vd)
 
 static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source, size_t source_length)
 {
+#ifdef HAVE_D3DX9EFFECT_H
     vout_display_sys_t *sys = vd->sys;
 
     HRESULT (WINAPI * OurD3DXCompileShader)(
@@ -1343,6 +1346,9 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source,
         return VLC_EGENERIC;
     }
     return VLC_SUCCESS;
+#else
+    return VLC_EGENERIC;
+#endif
 }
 
 #define MAX_SHADER_FILE_SIZE 1024*1024



More information about the vlc-commits mailing list