From 09e07e92c59d30a0a468a1035d19f50aca07caa9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 May 2016 22:03:53 +0200 Subject: [PATCH] vo_opengl: drop duplicate LUMINANCE_ALPHA handling This was supposed to handle the absence of GL_ARB_texture_rg. But it's already handled elsewhere. (init_format() sets texplane.swizzle accordingly.) --- video/out/opengl/video.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index ca10dada27..1116d994d1 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2768,17 +2768,10 @@ bool gl_video_showing_interpolated_frame(struct gl_video *p) } // dest = src. (always using 4 components) -static void packed_fmt_swizzle(char w[5], const struct gl_format *texfmt, - const struct packed_fmt_entry *fmt) +static void packed_fmt_swizzle(char w[5], const struct packed_fmt_entry *fmt) { - const char *comp = "rgba"; - - // Normally, we work with GL_RG - if (texfmt && texfmt->internal_format == GL_LUMINANCE_ALPHA) - comp = "ragb"; - for (int c = 0; c < 4; c++) - w[c] = comp[MPMAX(fmt->components[c] - 1, 0)]; + w[c] = "rgba"[MPMAX(fmt->components[c] - 1, 0)]; w[4] = '\0'; } @@ -2859,7 +2852,7 @@ static bool init_format(struct gl_video *p, int fmt, bool test_only) if (e->fmt == fmt) { int n_comp = desc.bytes[0] / e->component_size; plane_format[0] = gl_find_unorm_format(gl, e->component_size, n_comp); - packed_fmt_swizzle(color_swizzle, plane_format[0], e); + packed_fmt_swizzle(color_swizzle, e); goto supported; } }