summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-28 12:32:29 +0200
committerwm4 <wm4@nowhere>2013-08-28 23:08:28 +0200
commitfd2ead50808d81e488f322f90305e2bbb175e84b (patch)
tree59b83b0456afaa292d2b8a24695bd56b80f58f5d /video
parent33c03c4d0a33a9b39209a9ca528b007dda61560c (diff)
downloadmpv-fd2ead50808d81e488f322f90305e2bbb175e84b.tar.bz2
mpv-fd2ead50808d81e488f322f90305e2bbb175e84b.tar.xz
gl_video: don't crash if no FBOs are available
This probably has been broken since bbc865a: a test was added that uses a FBO, but it's always run, even if FBOs were not detected. On the other hand, fbotex_init() just runs into an assert. Fix the test that triggered this condition, and make fbotex_init() "nicer" by just failing if FBOs are not available.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index f6708694e5..083c1f40e9 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -433,7 +433,6 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h,
GL *gl = p->gl;
bool res = true;
- assert(gl->mpgl_caps & MPGL_CAP_FB);
assert(!fbo->fbo);
assert(!fbo->texture);
@@ -446,6 +445,9 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h,
MP_VERBOSE(p, "Create FBO: %dx%d\n", fbo->tex_w, fbo->tex_h);
+ if (!(gl->mpgl_caps & MPGL_CAP_FB))
+ return false;
+
gl->GenFramebuffers(1, &fbo->fbo);
gl->GenTextures(1, &fbo->texture);
gl->BindTexture(GL_TEXTURE_2D, fbo->texture);
@@ -1713,10 +1715,10 @@ static void check_gl_features(struct gl_video *p)
}
// fruit dithering mode and the 3D lut use this texture format
- if ((p->opts.dither_depth >= 0 && p->opts.dither_algo == 0) ||
- p->use_lut_3d)
+ if (have_fbo && ((p->opts.dither_depth >= 0 && p->opts.dither_algo == 0) ||
+ p->use_lut_3d))
{
- // doesn't disalbe anything; it's just for the log
+ // doesn't disable anything; it's just for the log
MP_VERBOSE(p, "Testing GL_R16 FBO (dithering/LUT)\n");
test_fbo(p, GL_R16);
}