vo_gpu_next: take into account PAR when taking screenshots

Using the width and height params directly doesn't actually work if PAR
is something other than 1. Instead, use mp_image_params_get_dsize and
calculate the correct dimensions which matches the vo_gpu behavior.
This commit is contained in:
Dudemanguy 2023-08-07 21:01:26 -05:00
parent a9c0ad149f
commit 983e8f0100
1 changed files with 2 additions and 1 deletions

View File

@ -1210,7 +1210,8 @@ 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) {
int w = mpi->params.w, h = mpi->params.h;
int w, h;
mp_image_params_get_dsize(&mpi->params, &w, &h);
if (mpi->params.rotate % 180 == 90)
MPSWAP(int, w, h);
src = dst = (struct mp_rect) {0, 0, w, h};