summaryrefslogtreecommitdiffstats
path: root/video/out/vo_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-19 20:04:31 +0100
committerwm4 <wm4@nowhere>2015-12-19 20:45:36 +0100
commit0a0bb9059f42671c267ea5d0c8faa3ac71a8c742 (patch)
tree89cbdee7748d36f98cc5d0efbfc8a3fc810b2016 /video/out/vo_lavc.c
parent1f7c099dc0feb9a160d9018ad6ad068e0295341a (diff)
downloadmpv-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/out/vo_lavc.c')
-rw-r--r--video/out/vo_lavc.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 09e8af748c..aae7f7b934 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -93,8 +93,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *vc = vo->priv;
enum AVPixelFormat pix_fmt = imgfmt2pixfmt(params->imgfmt);
- AVRational display_aspect_ratio, image_aspect_ratio;
- AVRational aspect;
+ AVRational aspect = {params->p_w, params->p_h};
uint32_t width = params->w;
uint32_t height = params->h;
@@ -103,12 +102,6 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
pthread_mutex_lock(&vo->encode_lavc_ctx->lock);
- display_aspect_ratio.num = params->d_w;
- display_aspect_ratio.den = params->d_h;
- image_aspect_ratio.num = width;
- image_aspect_ratio.den = height;
- aspect = av_div_q(display_aspect_ratio, image_aspect_ratio);
-
if (vc->stream) {
/* NOTE:
* in debug builds we get a "comparison between signed and unsigned"