From d77d9fb933e0e7dc34de02f3d0c13791ddd80114 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 10 Nov 2012 02:02:24 +0100 Subject: 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. --- video/filter/vf_screenshot.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'video/filter') diff --git a/video/filter/vf_screenshot.c b/video/filter/vf_screenshot.c index 29d2e0b1e0..d94bb3c5cf 100644 --- a/video/filter/vf_screenshot.c +++ b/video/filter/vf_screenshot.c @@ -91,11 +91,9 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) vf->priv->shot=0; mp_image_t image = *dmpi; image.flags &= ~MP_IMGFLAG_ALLOCATED; - 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; + mp_image_copy_attributes(&image, mpi); + mp_image_set_display_size(&image, vf->priv->image->display_w, + vf->priv->image->display_h); vf->priv->image_callback(vf->priv->image_callback_ctx, &image); } -- cgit v1.2.3