diff options
author | wm4 <wm4@nowhere> | 2015-03-21 17:32:59 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-21 17:32:59 +0100 |
commit | 6f5db977c062d237a83f102b0249965d19c07596 (patch) | |
tree | 461438d5c28d73bb0f7043950baf405d2c42b9c3 /video/out | |
parent | d790dbc3b5b29fb6f26f8510b97ee8f94688b833 (diff) | |
download | mpv-6f5db977c062d237a83f102b0249965d19c07596.tar.bz2 mpv-6f5db977c062d237a83f102b0249965d19c07596.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gl_video.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); |