From 4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Jan 2014 23:43:54 +0100 Subject: video/out: don't access aspdat in VOs vo->aspdat is basically an outdated version of vo->params, plus some weirdness. Get rid of it, which will allow further cleanups and which will make multithreading easier (less state to care about). Also, simplify some VO code by using mp_image_set_attributes() instead of caring about display size, colorspace, etc. manually. Add the function osd_res_from_image_params(), which is often needed in the case OSD renders into an image. --- video/out/vo_lavc.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'video/out/vo_lavc.c') diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index 8a784db37b..fe5bbcf775 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -487,16 +487,8 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) { struct priv *vc = vo->priv; - if (vc->lastimg && vc->lastimg_wants_osd) { - struct aspect_data asp = vo->aspdat; - double sar = (double)asp.orgw / asp.orgh; - double dar = (double)asp.prew / asp.preh; - - struct mp_osd_res dim = { - .w = asp.orgw, - .h = asp.orgh, - .display_par = sar / dar, - }; + if (vc->lastimg && vc->lastimg_wants_osd && vo->params) { + struct mp_osd_res dim = osd_res_from_image_params(vo->params); mp_image_set_colorspace_details(vc->lastimg, &vc->colorspace); -- cgit v1.2.3