[vlc-devel] [PATCH] vout:directd9: don't compile shaders if the headers are not available
Steve Lhomme
robux4 at videolabs.io
Mon Jun 12 09:47:39 CEST 2017
It's not found in MS headers anymore, only the old DirectX SDK from 2010.
---
configure.ac | 1 +
modules/video_output/win32/direct3d9.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index 43ce7a3e1a..e61833082a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3272,6 +3272,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 eecc2fa9e7..9c47579d40 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
--
2.12.1
More information about the vlc-devel
mailing list