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/out/vo_opengl_old.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'video/out/vo_opengl_old.c') diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index 3f629ed43e..a8ad21408e 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -806,11 +806,8 @@ static mp_image_t *get_screenshot(struct vo *vo) image->stride[2]); gl->ActiveTexture(GL_TEXTURE0); } - - image->w = p->image_width; - image->h = p->image_height; - image->display_w = vo->aspdat.prew; - image->display_h = vo->aspdat.preh; + mp_image_set_size(image, p->image_width, p->image_height); + mp_image_set_display_size(image, vo->aspdat.prew, vo->aspdat.preh); mp_image_set_colorspace_details(image, &p->colorspace); -- cgit v1.2.3