summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl_old.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-21 23:43:54 +0100
committerwm4 <wm4@nowhere>2014-01-22 00:35:52 +0100
commit4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3 (patch)
tree70638dee2c0ec0584bc3b859e2ecd41d7947524b /video/out/vo_opengl_old.c
parent302e8ff464663522234cfe5b182b9d84193b1981 (diff)
downloadmpv-4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3.tar.bz2
mpv-4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3.tar.xz
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.
Diffstat (limited to 'video/out/vo_opengl_old.c')
-rw-r--r--video/out/vo_opengl_old.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c
index 3ce009e3d0..0d877c5946 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -1458,11 +1458,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
struct mp_osd_res res = p->osd_res;
if (p->scaled_osd) {
- res = (struct mp_osd_res) {
- .w = p->image_width,
- .h = p->image_height,
- .display_par = 1.0 / vo->aspdat.par,
- };
+ res = osd_res_from_image_params(vo->params);
gl->MatrixMode(GL_MODELVIEW);
gl->PushMatrix();
// Setup image space -> screen space (assumes osd_res in screen space)
@@ -2009,6 +2005,9 @@ static mp_image_t *get_screenshot(struct vo *vo)
struct gl_priv *p = vo->priv;
GL *gl = p->gl;
+ if (!vo->params)
+ return NULL;
+
mp_image_t *image = mp_image_alloc(p->image_format, p->texture_width,
p->texture_height);
@@ -2025,9 +2024,7 @@ static mp_image_t *get_screenshot(struct vo *vo)
gl->ActiveTexture(GL_TEXTURE0);
}
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);
+ mp_image_set_attributes(image, vo->params);
return image;
}