mirror of https://github.com/mpv-player/mpv
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...
This commit is contained in:
parent
e300bfcf3a
commit
c296b6204f
|
@ -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_w = 1.0 / (1 << p->image_desc.chroma_xs);
|
||||||
float ls_h = 1.0 / (1 << p->image_desc.chroma_ys);
|
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}}};
|
struct gl_transform chroma = {{{ls_w, 0.0}, {0.0, ls_h}}};
|
||||||
|
|
||||||
if (p->image_params.chroma_location != MP_CHROMA_CENTER) {
|
if (p->image_params.chroma_location != MP_CHROMA_CENTER) {
|
||||||
|
|
Loading…
Reference in New Issue