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.
This commit is contained in:
wm4 2015-03-21 17:32:59 +01:00
parent d790dbc3b5
commit 6f5db977c0
1 changed files with 5 additions and 7 deletions

View File

@ -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);