diff options
author | wm4 <wm4@nowhere> | 2012-10-26 20:19:06 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-01 02:07:45 +0100 |
commit | c62efc52c6c5f9dc9cf8e335f6e934e69a721331 (patch) | |
tree | f29779dd1e4624dba1e7d0824eca93a8ce9f7a4e /libmpcodecs | |
parent | 738aeb1c60c6ffe95e915e443598f8a51081bdfb (diff) | |
download | mpv-c62efc52c6c5f9dc9cf8e335f6e934e69a721331.tar.bz2 mpv-c62efc52c6c5f9dc9cf8e335f6e934e69a721331.tar.xz |
screenshot: remove hack for passing anamorphic image size
With anamorphic video (display with non-1:1 PAR, e.g. DVD), the display
size was passed using the mp_image fields w/h, which was blatantly
incorrect. w/h are the normal image dimensions, while width/height are
the "uncropped" storage size (used internally by vf.c).
Add a display_w/h, and use that for the display size. Make all VOs that
can do screenshots use it.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/mp_image.h | 3 | ||||
-rw-r--r-- | libmpcodecs/vf.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libmpcodecs/mp_image.h b/libmpcodecs/mp_image.h index fa5e7032f9..84a6f3260d 100644 --- a/libmpcodecs/mp_image.h +++ b/libmpcodecs/mp_image.h @@ -104,8 +104,9 @@ typedef struct mp_image { int number; unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8 unsigned int imgfmt; - int width,height; // stored dimensions + int width,height; // internal to vf.c, do not use (stored dimensions) int w,h; // visible dimensions + int display_w,display_h; // if set (!= 0), anamorphic size uint8_t *planes[MP_MAX_PLANES]; int stride[MP_MAX_PLANES]; char * qscale; diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 5f4da28dee..fbaa1cf2a7 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -537,6 +537,8 @@ void vf_clone_mpi_attributes(mp_image_t *dst, mp_image_t *src) if (dst->width == src->width && dst->height == src->height) { dst->qstride = src->qstride; dst->qscale = src->qscale; + dst->display_w = src->display_w; + dst->display_h = src->display_h; } if ((dst->flags & MP_IMGFLAG_YUV) == (src->flags & MP_IMGFLAG_YUV)) { dst->colorspace = src->colorspace; |