summaryrefslogtreecommitdiffstats
path: root/video/filter
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/filter
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/filter')
-rw-r--r--video/filter/vf_screenshot.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/filter/vf_screenshot.c b/video/filter/vf_screenshot.c
index 8b937b0648..e4ba696f69 100644
--- a/video/filter/vf_screenshot.c
+++ b/video/filter/vf_screenshot.c
@@ -49,8 +49,8 @@ static int config(struct vf_instance *vf,
free_mp_image(vf->priv->image);
vf->priv->image = new_mp_image(width, height);
mp_image_setfmt(vf->priv->image, outfmt);
- vf->priv->image->w = d_width;
- vf->priv->image->h = d_height;
+ vf->priv->image->display_w = d_width;
+ vf->priv->image->display_h = d_height;
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
@@ -142,6 +142,8 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
image.w = vf->priv->image->w;
image.h = vf->priv->image->h;
vf_clone_mpi_attributes(&image, mpi);
+ image.display_w = vf->priv->image->display_w;
+ image.display_h = vf->priv->image->display_h;
vf->priv->image_callback(vf->priv->image_callback_ctx, &image);
vf->priv->store_slices = 0;
}