From b52c7273f489f2b91b8113fe89c61b51c3962a10 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 Oct 2014 23:44:10 +0200 Subject: vo_opengl: fix theoretical format mismatch issue This would have been wrong for hw decoders which pass us NV12 or NV21. The format the GL shader filter chain gets is stored in p->image_desc, while p->image_format still contains the "real" input format (which in case of hw decoding is an opsque hw accel format). Since no hw decoder did this, this is really just a theoretical fix and doesn't fix any actual bugs. --- video/out/gl_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 5608b48938..a3f267a2eb 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -167,10 +167,10 @@ struct gl_video { uint32_t image_w, image_h; uint32_t image_dw, image_dh; - uint32_t image_format; + uint32_t image_format; // "real" input format int texture_w, texture_h; - struct mp_imgfmt_desc image_desc; + struct mp_imgfmt_desc image_desc; // input format for shader filter chain bool is_yuv, is_rgb, is_packed_yuv; bool is_linear_rgb; @@ -958,7 +958,7 @@ static void compile_shaders(struct gl_video *p) char *header_final = talloc_strdup(tmp, ""); char *header_sep = NULL; - if (p->image_format == IMGFMT_NV12 || p->image_format == IMGFMT_NV21) { + if (p->image_desc.id == IMGFMT_NV12 || p->image_desc.id == IMGFMT_NV21) { shader_def(&header_conv, "USE_CONV", "CONV_NV12"); } else if (p->plane_count > 1) { shader_def(&header_conv, "USE_CONV", "CONV_PLANAR"); @@ -966,7 +966,7 @@ static void compile_shaders(struct gl_video *p) if (p->color_swizzle[0]) shader_def(&header_conv, "USE_COLOR_SWIZZLE", p->color_swizzle); - shader_def_opt(&header_conv, "USE_SWAP_UV", p->image_format == IMGFMT_NV21); + shader_def_opt(&header_conv, "USE_SWAP_UV", p->image_desc.id == IMGFMT_NV21); shader_def_opt(&header_conv, "USE_YGRAY", p->is_yuv && !p->is_packed_yuv && p->plane_count == 1); shader_def_opt(&header_conv, "USE_INPUT_GAMMA", use_input_gamma); -- cgit v1.2.3