From 983e8f0100b98bd8aed48e5fe86dd5682174b04e Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 7 Aug 2023 21:01:26 -0500 Subject: [PATCH] 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. --- video/out/vo_gpu_next.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 403620fd63..7b9c477309 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -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};