diff options
author | wm4 <wm4@nowhere> | 2014-04-29 13:27:07 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-29 13:27:07 +0200 |
commit | a69e91756d77cff367c0def6211baf27da88677f (patch) | |
tree | fc9ede130f6b51a80c7adeff2ba47b2667d229b8 | |
parent | 81171e37b2c90bdb9b3b9c79d9cab1774760326e (diff) | |
download | mpv-a69e91756d77cff367c0def6211baf27da88677f.tar.bz2 mpv-a69e91756d77cff367c0def6211baf27da88677f.tar.xz |
vo_vdpau: let vdpau scale anamorphic screenshots
In theory, returning the screenshot with original pixel aspect would
allow avoiding scaling them with image formats that support non-square
pixels, but in practice this isn't used anyway (nothing seems to
understand e.g. jpeg aspect ratio tags).
-rw-r--r-- | video/out/vo_vdpau.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 40168cb734..85e5fb0d2a 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1237,15 +1237,11 @@ static struct mp_image *get_screenshot(struct vo *vo) CHECK_VDP_WARNING(vo, "Error when calling vdp_output_surface_create"); } - VdpRect rc = { .x1 = vc->vid_width, .y1 = vc->vid_height }; - render_video_to_output_surface(vo, vc->screenshot_surface, &rc, &rc); + VdpRect in = { .x1 = vo->params->w, .y1 = vo->params->h }; + VdpRect out = { .x1 = vo->params->d_w, .y1 = vo->params->d_h }; + render_video_to_output_surface(vo, vc->screenshot_surface, &out, &in); - struct mp_image *image = read_output_surface(vo, vc->screenshot_surface, - vc->vid_width, vc->vid_height); - - mp_image_set_display_size(image, vo->params->d_w, vo->params->d_h); - - return image; + return read_output_surface(vo, vc->screenshot_surface, out.x1, out.y1); } static struct mp_image *get_window_screenshot(struct vo *vo) |