diff options
author | Dudemanguy <random342@airmail.cc> | 2023-08-08 21:18:41 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-08-08 21:28:10 -0500 |
commit | efefe3a6dcfb969ab9f5800b7aecb3ba685ffdbe (patch) | |
tree | 1f614199ecfe8d43f6b04018cbc64daf39e7b53c /video | |
parent | bc52159cb9af7f82fa94d2986e4d5712f1b8c08d (diff) | |
download | mpv-efefe3a6dcfb969ab9f5800b7aecb3ba685ffdbe.tar.bz2 mpv-efefe3a6dcfb969ab9f5800b7aecb3ba685ffdbe.tar.xz |
vo_gpu_next: actually fix screenshots with PAR
983e8f0100b98bd8aed48e5fe86dd5682174b04e 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).
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_gpu_next.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 7b9c477309..52831406b5 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -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, |