diff options
author | wm4 <wm4@nowhere> | 2014-01-21 23:43:54 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-22 00:35:52 +0100 |
commit | 4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3 (patch) | |
tree | 70638dee2c0ec0584bc3b859e2ecd41d7947524b /video/out/vo_vdpau.c | |
parent | 302e8ff464663522234cfe5b182b9d84193b1981 (diff) | |
download | mpv-4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3.tar.bz2 mpv-4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3.tar.xz |
video/out: don't access aspdat in VOs
vo->aspdat is basically an outdated version of vo->params, plus some
weirdness. Get rid of it, which will allow further cleanups and which
will make multithreading easier (less state to care about).
Also, simplify some VO code by using mp_image_set_attributes() instead
of caring about display size, colorspace, etc. manually. Add the
function osd_res_from_image_params(), which is often needed in the case
OSD renders into an image.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r-- | video/out/vo_vdpau.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index c93c3eb0a6..90460a9ff4 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1239,6 +1239,9 @@ static struct mp_image *get_screenshot(struct vo *vo) VdpStatus vdp_st; struct vdp_functions *vdp = vc->vdp; + if (!vo->params) + return NULL; + if (vc->screenshot_surface == VDP_INVALID_HANDLE) { vdp_st = vdp->output_surface_create(vc->vdp_device, OUTPUT_RGBA_FORMAT, @@ -1253,7 +1256,7 @@ static struct mp_image *get_screenshot(struct vo *vo) struct mp_image *image = read_output_surface(vo, vc->screenshot_surface, vc->vid_width, vc->vid_height); - mp_image_set_display_size(image, vo->aspdat.prew, vo->aspdat.preh); + mp_image_set_display_size(image, vo->params->d_w, vo->params->d_h); return image; } |