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_direct3d.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/out/vo_direct3d.c') diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index 10539d4f18..eae04eecb8 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -1432,15 +1432,15 @@ static mp_image_t *get_screenshot(d3d_priv *priv) if (!priv->have_image) return NULL; + if (!priv->vo->params) + return NULL; + struct mp_image buffer; if (!get_video_buffer(priv, &buffer)) return NULL; struct mp_image *image = mp_image_new_copy(&buffer); - mp_image_set_display_size(image, priv->vo->aspdat.prew, - priv->vo->aspdat.preh); - - mp_image_set_colorspace_details(image, &priv->colorspace); + mp_image_set_attributes(image, priv->vo->params); d3d_unlock_video_objects(priv); return image; -- cgit v1.2.3