vo_gpu: fix taking screenshots of rotated videos

This commit is contained in:
wnoun authored and sfan5 committed 2019-08-14 21:54:14 +02:00
1 parent 639ee55df7
commit ae8cb39ab2
1 file changed
+6 -2
+6 -2
View File
@@ -3320,10 +3320,14 @@ void gl_video_screenshot(struct gl_video *p, struct vo_frame *frame,
if (w < 1 || h < 1)
return;
if (p->image_params.rotate % 180 == 90)
int src_w = p->image_params.w;
int src_h = p->image_params.h;
if (p->image_params.rotate % 180 == 90) {
MPSWAP(int, w, h);
MPSWAP(int, src_w, src_h);
}
struct mp_rect src = {0, 0, p->image_params.w, p->image_params.h};
struct mp_rect src = {0, 0, src_w, src_h};
struct mp_rect dst = {0, 0, w, h};
struct mp_osd_res osd = {.w = w, .h = h, .display_par = 1.0};
gl_video_resize(p, &src, &dst, &osd);