summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-28 23:30:54 +0100
committerwm4 <wm4@nowhere>2013-03-28 23:30:54 +0100
commit5d8b50bda8184b5fe5206cd9349666764a590af9 (patch)
tree15bb6026e0af962b4e7b093ac4f623fef2992f43 /video
parent6232fa26b3fc3042ecbb8436ec636368fb606141 (diff)
downloadmpv-5d8b50bda8184b5fe5206cd9349666764a590af9.tar.bz2
mpv-5d8b50bda8184b5fe5206cd9349666764a590af9.tar.xz
gl_video: fix OSX by not using undefined name in GLSL "#if"
The OSX shader compiler was giving this error: ERROR: 0:235: '' : syntax error incorrect preprocessor directive on this line: [235] #if USE_CONV == CONV_PLANAR USE_CONV was undefined in some cases. The expected behavior is that the shader preprocessor interprets this as branch not taken (AFAIK exactly as in C), which is probably what the standard would dictate. This is possible an OSX bug. But admittedly, I'm not sure whether this is really standard behavior (in C or GLSL), and doing this is extremely weird at best, so make sure that USE_CONV is always defined. Should fix behavior on OSX.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 22f4100e9a..5f63c9517f 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -703,6 +703,8 @@ static void compile_shaders(struct gl_video *p)
shader_def(&header_conv, "USE_CONV", "CONV_NV12");
} else if (p->plane_count > 1) {
shader_def(&header_conv, "USE_CONV", "CONV_PLANAR");
+ } else {
+ shader_def(&header_conv, "USE_CONV", "0");
}
shader_def_opt(&header_conv, "USE_GBRP", p->image_format == IMGFMT_GBRP);