screenshot: hack against w/width confusion

struct mp_image has two sets of size members: width/height and w/h. It's
not even sure which one of these is the ACTUAL dimension, and which is
the "stored" or "visible" dimension. vf_get_image() (a core function for
video filters) does something confusing with the sizes, and often sets
up cropped versions of other filter's image buffers. The screenshot code
uses w/h to store the display size for anamorphic video, while
width/height is the size of the pixel data. The draw_bmp.c code, as well
as sws_utils.c, always use w/h for the size of the pixel data.

It's an unholy mess, and the screenshot code potentially breaks it even
more. Work that around with a hack, until we hopefully clean up
mp_image and the video filter code.
This commit is contained in:
wm4 2012-10-21 17:12:42 +02:00
parent 4b4e4b5690
commit 6bea013e27
1 changed files with 5 additions and 1 deletions

View File

@ -255,8 +255,12 @@ static struct mp_image *add_subs(struct MPContext *mpctx,
.display_par = sar / dar,
.video_par = dar / sar,
};
// It's not really clear what's the difference between w and width
struct mp_image hack = *image;
hack.w = hack.width;
hack.h = hack.height;
osd_draw_on_image(mpctx->osd, res, mpctx->osd->vo_pts,
OSD_DRAW_SUB_ONLY, image, csp);
OSD_DRAW_SUB_ONLY, &hack, csp);
return image;
}