diff options
author | wm4 <wm4@nowhere> | 2015-12-19 20:04:31 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-19 20:45:36 +0100 |
commit | 0a0bb9059f42671c267ea5d0c8faa3ac71a8c742 (patch) | |
tree | 89cbdee7748d36f98cc5d0efbfc8a3fc810b2016 /video/filter/vf_scale.c | |
parent | 1f7c099dc0feb9a160d9018ad6ad068e0295341a (diff) | |
download | mpv-0a0bb9059f42671c267ea5d0c8faa3ac71a8c742.tar.bz2 mpv-0a0bb9059f42671c267ea5d0c8faa3ac71a8c742.tar.xz |
video: switch from using display aspect to sample aspect
MPlayer traditionally always used the display aspect ratio, e.g. 16:9,
while FFmpeg uses the sample (aka pixel) aspect ratio.
Both have a bunch of advantages and disadvantages. Actually, it seems
using sample aspect ratio is generally nicer. The main reason for the
change is making mpv closer to how FFmpeg works in order to make life
easier. It's also nice that everything uses integer fractions instead
of floats now (except --video-aspect option/property).
Note that there is at least 1 user-visible change: vf_dsize now does
not set the display size, only the display aspect ratio. This is
because the image_params d_w/d_h fields did not just set the display
aspect, but also the size (except in encoding mode).
Diffstat (limited to 'video/filter/vf_scale.c')
-rw-r--r-- | video/filter/vf_scale.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c index a71f2c1038..518ff41beb 100644 --- a/video/filter/vf_scale.c +++ b/video/filter/vf_scale.c @@ -76,7 +76,10 @@ static int find_best_out(vf_instance_t *vf, int in_format) static int reconfig(struct vf_instance *vf, struct mp_image_params *in, struct mp_image_params *out) { - int width = in->w, height = in->h, d_width = in->d_w, d_height = in->d_h; + int width = in->w, height = in->h; + int d_width, d_height; + mp_image_params_get_dsize(in, &d_width, &d_height); + unsigned int best = find_best_out(vf, in->imgfmt); int round_w = 0, round_h = 0; @@ -154,8 +157,7 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, *out = *in; out->w = vf->priv->w; out->h = vf->priv->h; - out->d_w = d_width; - out->d_h = d_height; + mp_image_params_set_dsize(out, d_width, d_height); out->imgfmt = best; // Second-guess what libswscale is going to output and what not. |