From 6f5db977c062d237a83f102b0249965d19c07596 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Mar 2015 17:32:59 +0100 Subject: vo_opengl: fix background color option gl_video_set_options() didn't update it, so the default value set on initialization was used. Fix by always setting the clear color before the clear command; it's slightly easier to follow too. --- video/out/gl_video.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'video') diff --git a/video/out/gl_video.c b/video/out/gl_video.c index a15784228d..9674ac58ee 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1846,16 +1846,16 @@ void gl_video_render_frame(struct gl_video *p, int fbo, struct frame_timing *t) gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); - if (p->dst_rect.x0 > 0 || p->dst_rect.y0 > 0 - || p->dst_rect.x1 < p->vp_w || p->dst_rect.y1 < abs(p->vp_h)) + if (!vimg->mpi || p->dst_rect.x0 > 0 || p->dst_rect.y0 > 0 || + p->dst_rect.x1 < p->vp_w || p->dst_rect.y1 < abs(p->vp_h)) { + struct m_color c = p->opts.background; + gl->ClearColor(c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0); gl->Clear(GL_COLOR_BUFFER_BIT); } - if (!vimg->mpi) { - gl->Clear(GL_COLOR_BUFFER_BIT); + if (!vimg->mpi) goto draw_osd; - } gl_sc_set_vao(p->sc, &p->vao); @@ -2193,8 +2193,6 @@ void gl_video_set_gl_state(struct gl_video *p) { GL *gl = p->gl; - struct m_color c = p->opts.background; - gl->ClearColor(c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0); gl->ActiveTexture(GL_TEXTURE0); if (gl->mpgl_caps & MPGL_CAP_ROW_LENGTH) gl->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); -- cgit v1.2.3