From a69e91756d77cff367c0def6211baf27da88677f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Apr 2014 13:27:07 +0200 Subject: 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). --- video/out/vo_vdpau.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'video') 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) -- cgit v1.2.3