mirror of https://github.com/mpv-player/mpv
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:
parent
a9c0ad149f
commit
983e8f0100
|
@ -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_rect src = p->src, dst = p->dst;
|
||||||
struct mp_osd_res osd = p->osd_res;
|
struct mp_osd_res osd = p->osd_res;
|
||||||
if (!args->scaled) {
|
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)
|
if (mpi->params.rotate % 180 == 90)
|
||||||
MPSWAP(int, w, h);
|
MPSWAP(int, w, h);
|
||||||
src = dst = (struct mp_rect) {0, 0, w, h};
|
src = dst = (struct mp_rect) {0, 0, w, h};
|
||||||
|
|
Loading…
Reference in New Issue