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)
This commit is contained in:
Niklas Haas 2022-09-27 21:26:41 +02:00
parent 1c05a30e95
commit 3376f775e3
1 changed files with 6 additions and 3 deletions

View File

@ -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,
};
}