0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

vo_gpu_next: actually fix screenshots with PAR

983e8f0100 resulted in the correct
dimensions, but it was not actually right because vo_gpu_next still had
the src and dst rects the same. This just needs to work like how vo_gpu
does where the src is the image params and the dst is desired output. So
basically, just copy that code over here. Fixes #12108 and as a bonus,
overriding the aspect ratio now results in correct screenshots
(previously didn't work at now and then with the above commit it had
correct dimensions but still incorrect output).
This commit is contained in:
Dudemanguy 2023-08-08 21:18:41 -05:00
parent bc52159cb9
commit efefe3a6dc

View File

@ -1212,9 +1212,17 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
if (!args->scaled) {
int w, h;
mp_image_params_get_dsize(&mpi->params, &w, &h);
if (mpi->params.rotate % 180 == 90)
if (w < 1 || h < 1)
return;
int src_w = mpi->params.w;
int src_h = mpi->params.h;
if (mpi->params.rotate % 180 == 90) {
MPSWAP(int, w, h);
src = dst = (struct mp_rect) {0, 0, w, h};
MPSWAP(int, src_w, src_h);
}
src = (struct mp_rect) {0, 0, src_w, src_h};
dst = (struct mp_rect) {0, 0, w, h};
osd = (struct mp_osd_res) {
.display_par = 1.0,
.w = w,