summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-28 12:32:29 +0200
committerwm4 <wm4@nowhere>2013-08-29 19:20:14 +0200
commit64faa8c66b2722df5c13c7d8342e767578d658fd (patch)
treec5ceb00265b02af795e60845532b0c5dba75c45f
parent2f26f0b052a3b94b0b2abfbea81f029e4e6e9516 (diff)
downloadmpv-64faa8c66b2722df5c13c7d8342e767578d658fd.tar.bz2
mpv-64faa8c66b2722df5c13c7d8342e767578d658fd.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.
-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 7cce15e884..719c06d54a 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);
}