summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 6ad1db6b90..49b99e90b5 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2643,6 +2643,17 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
return;
}
+ if (p->fb_depth == 0) {
+ debug_check_gl(p, "before retrieving framebuffer depth");
+ p->fb_depth = gl_get_fb_depth(gl, fbo);
+ debug_check_gl(p, "retrieving framebuffer depth");
+ if (p->fb_depth > 0) {
+ MP_VERBOSE(p, "Reported display depth: %d\n", p->fb_depth);
+ } else {
+ p->fb_depth = 8;
+ }
+ }
+
p->broken_frame = false;
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);
@@ -3127,15 +3138,6 @@ static void init_gl(struct gl_video *p)
if (p->texture_16bit_depth > 0)
MP_VERBOSE(p, "16 bit texture depth: %d.\n", p->texture_16bit_depth);
- debug_check_gl(p, "before retrieving framebuffer depth");
- p->fb_depth = gl_get_fb_depth(gl, gl->main_fb);
- debug_check_gl(p, "retrieving framebuffer depth");
- if (p->fb_depth > 0) {
- MP_VERBOSE(p, "Reported display depth: %d\n", p->fb_depth);
- } else {
- p->fb_depth = 8;
- }
-
p->upload_timer = gl_timer_create(p->gl);
p->render_timer = gl_timer_create(p->gl);
p->present_timer = gl_timer_create(p->gl);