diff options
author | wm4 <wm4@nowhere> | 2014-01-21 23:43:54 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-22 00:35:52 +0100 |
commit | 4de73fd5c18b982d0a89e2381fcdb3c1e3fea4e3 (patch) | |
tree | 70638dee2c0ec0584bc3b859e2ecd41d7947524b /video/out/vo_corevideo.c | |
parent | 302e8ff464663522234cfe5b182b9d84193b1981 (diff) | |
download | mpv-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_corevideo.c')
-rw-r--r-- | video/out/vo_corevideo.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/video/out/vo_corevideo.c b/video/out/vo_corevideo.c index 20769d7ca1..d9e28e80fc 100644 --- a/video/out/vo_corevideo.c +++ b/video/out/vo_corevideo.c @@ -279,7 +279,7 @@ static int get_image_fmt(struct vo *vo, CVPixelBufferRef pbuf) static mp_image_t *get_screenshot(struct vo *vo, CVPixelBufferRef pbuf) { int img_fmt = get_image_fmt(vo, pbuf); - if (img_fmt < 0) return NULL; + if (img_fmt < 0 || !vo->params) return NULL; struct priv *p = vo->priv; CVPixelBufferLockBaseAddress(pbuf, 0); @@ -295,8 +295,7 @@ static mp_image_t *get_screenshot(struct vo *vo, CVPixelBufferRef pbuf) img.stride[0] = stride; struct mp_image *image = mp_image_new_copy(&img); - 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); CVPixelBufferUnlockBaseAddress(pbuf, 0); return image; |