diff options
-rw-r--r-- | video/out/opengl/context_x11.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/opengl/context_x11.c b/video/out/opengl/context_x11.c index 46e9f0cb7e..4327a8a025 100644 --- a/video/out/opengl/context_x11.c +++ b/video/out/opengl/context_x11.c @@ -173,8 +173,8 @@ static GLXFBConfig select_fb_config(struct vo *vo, const int *attribs, int flags // a depth of 24, even if the pixels are padded to 32 bit. If the // depth is higher than 24, the remaining bits must be alpha. // Note: vinfo->bits_per_rgb appears to be useless (is always 8). - unsigned long mask = v->depth == 32 ? - (unsigned long)-1 : (1 << (unsigned long)v->depth) - 1; + unsigned long mask = v->depth == sizeof(unsigned long) * 8 ? + (unsigned long)-1 : (1UL << v->depth) - 1; if (mask & ~(v->red_mask | v->green_mask | v->blue_mask)) { fbconfig = fbc[n]; break; @@ -272,6 +272,7 @@ static int glx_init(struct MPGLContext *ctx, int flags) glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->gl->fb_r); glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->gl->fb_g); glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_BLUE_SIZE, &ctx->gl->fb_b); + ctx->gl->fb_premultiplied = true; return 0; |