summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-25 12:29:19 +0100
committerwm4 <wm4@nowhere>2015-03-25 12:29:19 +0100
commit85c21ae40940d6c54e36b5822e9ac1a517185b07 (patch)
tree37e662c833eb9e622514f40d46d5ffd7755df81f /video/out/vo_opengl.c
parentcdf9abd872f1923ef5a185d06b412f342935f107 (diff)
downloadmpv-85c21ae40940d6c54e36b5822e9ac1a517185b07.tar.bz2
mpv-85c21ae40940d6c54e36b5822e9ac1a517185b07.tar.xz
vo_opengl: cleanup swap_control extension loading
Instead of somehow looking for the substring "_swap_control" and trying to several arbitrary function names, do it cleanly. The old approach has the problem that it's not very exact, and may even load a pointer to a function which doesn't exist. (Some GL implementations like Mesa return function pointers even the functions which don't exist, and calling them crashes.) I couldn't find any evidence that glXSwapInterval, wglSwapIntervalSGI, or wglSwapInterval actually exist, so don't include them. They were carried over from MPlayer times. To make diagnostics easier, print a warning in verbose mode if the function could not be loaded.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 25e25a2e9d..9cf58286e2 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -463,8 +463,11 @@ static int preinit(struct vo *vo)
mpgl_lock(p->glctx);
- if (p->gl->SwapInterval)
+ if (p->gl->SwapInterval) {
p->gl->SwapInterval(p->swap_interval);
+ } else {
+ MP_VERBOSE(vo, "swap_control extension missing.\n");
+ }
p->renderer = gl_video_init(p->gl, vo->log);
if (!p->renderer)