summaryrefslogtreecommitdiffstats
path: root/video/out/vo_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-21 19:40:33 +0100
committerwm4 <wm4@nowhere>2012-11-21 19:58:51 +0100
commit4b91861b6710e9f82618b58841e08986e965eb43 (patch)
tree88fc224a0f7b55531e04ccbea16fb904a0d11d72 /video/out/vo_image.c
parented01dfeff305b09f7027cb18b1f9283fb859a9c8 (diff)
downloadmpv-4b91861b6710e9f82618b58841e08986e965eb43.tar.bz2
mpv-4b91861b6710e9f82618b58841e08986e965eb43.tar.xz
video: fix bogus uses of mp_image.w/width
mp_image has this confusing distinction between the w/h and width/height fields. w/h are the actual width and height, while width/height have a very special meaning inside the video filter code: it's the actually allocated width, which is also used for stride padding. Screenshot related code abused the w/h fields to store the aspect corrected size. Some code confused the role of w/h and width/height. Fix these issues. For aspect corrected size, display_w/h are used, while width/height should never be used outside vf.c internals and related code. This also fixes an actual bug when taking screenshots of anamorphic video with vf_screenshot, as well as using vo_image with such videos.
Diffstat (limited to 'video/out/vo_image.c')
-rw-r--r--video/out/vo_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index 76adf5a665..e4d8636038 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -101,8 +101,8 @@ static uint32_t draw_image(struct vo *vo, mp_image_t *mpi)
struct priv *p = vo->priv;
mp_image_t img = *mpi;
- img.width = p->d_width;
- img.height = p->d_height;
+ img.display_w = p->d_width;
+ img.display_h = p->d_height;
mp_image_set_colorspace_details(&img, &p->colorspace);
void *t = talloc_new(NULL);