summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-09-27 21:26:41 +0200
committerNiklas Haas <git@haasn.dev>2022-09-27 21:32:46 +0200
commit3376f775e335560fe49c53167a1b402b81fda677 (patch)
treec04422f4cceda18fe2cebb02aa41b4e5ffc7489e /video/out
parent1c05a30e951f973f8cd8173a30d1fe0df59fd390 (diff)
downloadmpv-3376f775e335560fe49c53167a1b402b81fda677.tar.bz2
mpv-3376f775e335560fe49c53167a1b402b81fda677.tar.xz
vo_gpu_next: fix screenshots of rotated sources
I actually don't quite understand why this is needed, since in theory we should already be doing the rotation as part of applying the crop. But I guess that code doesn't quite work. This is the only way it works, so it's probably correct. (And note that `vo_gpu` does the same internally)
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_gpu_next.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 10a16a5f4f..e48ba4032f 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1124,11 +1124,14 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
struct mp_rect src = p->src, dst = p->dst;
struct mp_osd_res osd = p->osd_res;
if (!args->scaled) {
- src = dst = (struct mp_rect) {0, 0, mpi->params.w, mpi->params.h};
+ int w = mpi->params.w, h = mpi->params.h;
+ if (mpi->params.rotate % 180 == 90)
+ MPSWAP(int, w, h);
+ src = dst = (struct mp_rect) {0, 0, w, h};
osd = (struct mp_osd_res) {
- .w = mpi->params.w,
- .h = mpi->params.h,
.display_par = 1.0,
+ .w = w,
+ .h = h,
};
}