diff options
author | wm4 <wm4@nowhere> | 2014-10-16 23:44:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-16 23:44:10 +0200 |
commit | b52c7273f489f2b91b8113fe89c61b51c3962a10 (patch) | |
tree | 2e6d749fa68f6d5e9cacdfc7c32b471312650ea5 | |
parent | a0ac8b6331d345748d415cf71affbe7a90e336a6 (diff) | |
download | mpv-b52c7273f489f2b91b8113fe89c61b51c3962a10.tar.bz2 mpv-b52c7273f489f2b91b8113fe89c61b51c3962a10.tar.xz |
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.
-rw-r--r-- | video/out/gl_video.c | 8 |
1 files 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); |