summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-22 15:16:53 +0200
committerwm4 <wm4@nowhere>2016-09-22 15:16:53 +0200
commitc296b6204fcace8a3ad99c08fa5d2931b70e57cc (patch)
tree372654e760aab7a2b624bf2742c814cfe3a6b960
parente300bfcf3afd47d0124d940cb6bf395c53deba7c (diff)
downloadmpv-c296b6204fcace8a3ad99c08fa5d2931b70e57cc.tar.bz2
mpv-c296b6204fcace8a3ad99c08fa5d2931b70e57cc.tar.xz
vo_opengl: apply 90° rotation to chroma texture size
When we rotate the inmage by 90° or 270°, chroma width and height need to be swapped. Fixes #3568. But is the chroma sub location correct? Who the hell knows...
-rw-r--r--video/out/opengl/video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 5b1020f65e..ab799f3583 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -762,6 +762,9 @@ static void pass_get_img_tex(struct gl_video *p, struct video_image *vimg,
float ls_w = 1.0 / (1 << p->image_desc.chroma_xs);
float ls_h = 1.0 / (1 << p->image_desc.chroma_ys);
+ if (p->image_params.rotate % 180 == 90)
+ MPSWAP(float, ls_w, ls_h);
+
struct gl_transform chroma = {{{ls_w, 0.0}, {0.0, ls_h}}};
if (p->image_params.chroma_location != MP_CHROMA_CENTER) {