summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-07-04 13:34:31 +0200
committerwm4 <wm4@nowhere>2016-07-04 13:34:31 +0200
commitf98e1b0b966d11b50df79d04dbab54ca20a08319 (patch)
tree137e3caeac5eaa145ce3826b13b1c51e5263cc9c
parent7cd1a3c766d002eb91790aa6d57f1828acd372ca (diff)
downloadmpv-f98e1b0b966d11b50df79d04dbab54ca20a08319.tar.bz2
mpv-f98e1b0b966d11b50df79d04dbab54ca20a08319.tar.xz
vo_opengl: error out gracefully when trying to use FBOs without FBO API
This can for example happen with vo_opengl_cb, if it is used with a GL implementation that does not supports FBOs. (mpv itself should never attempt to use FBOs if they're not available.) Without this check it would trigger an assert() in our dummy glBindFramebuffer wrapper. Suspected cause of #3308, although it's still unlikely.
-rw-r--r--video/out/opengl/video.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 7ae91eed0d..468bee90b5 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2667,6 +2667,11 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
GL *gl = p->gl;
struct video_image *vimg = &p->image;
+ if (fbo && !(gl->mpgl_caps & MPGL_CAP_FB)) {
+ MP_FATAL(p, "Rendering to FBO requested, but no FBO extension found!\n");
+ return;
+ }
+
p->broken_frame = false;
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);