summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-10 02:02:24 +0100
committerwm4 <wm4@nowhere>2013-01-13 17:39:32 +0100
commitd77d9fb933e0e7dc34de02f3d0c13791ddd80114 (patch)
treeca45e0f9d753e7ee7b5bd142eb2aed1638bf391c /video/out/vo_vdpau.c
parent1568161aadf24ee3a6d982612b7380f8b1dc4a58 (diff)
downloadmpv-d77d9fb933e0e7dc34de02f3d0c13791ddd80114.tar.bz2
mpv-d77d9fb933e0e7dc34de02f3d0c13791ddd80114.tar.xz
mp_image: require using mp_image_set_size() for setting w/h
Setting the size of a mp_image must be done with mp_image_set_size() now. Do this to guarantee that the redundant fields (like chroma_width) are updated consistently. Replacing the redundant fields by function calls would probably be better, but there are too many uses of them, and is a bit less convenient. Most code actually called mp_image_setfmt(), which did this as well. This commit just makes things a bit more explicit. Warning: the video filter chain still sets up mp_images manually, and vf_get_image() is not updated.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 67ac0593f8..661072b814 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1375,8 +1375,7 @@ static struct mp_image *get_screenshot(struct vo *vo)
struct mp_image *image = read_output_surface(vc, vc->screenshot_surface,
vc->vid_width, vc->vid_height);
- image->display_w = vo->aspdat.prew;
- image->display_h = vo->aspdat.preh;
+ mp_image_set_display_size(image, vo->aspdat.prew, vo->aspdat.preh);
return image;
}
@@ -1389,8 +1388,7 @@ static struct mp_image *get_window_screenshot(struct vo *vo)
struct mp_image *image = read_output_surface(vo->priv, screen,
vc->output_surface_width,
vc->output_surface_height);
- image->width = image->w = vo->dwidth;
- image->height = image->h = vo->dheight;
+ mp_image_set_size(image, vo->dwidth, vo->dheight);
return image;
}