From 0a0bb9059f42671c267ea5d0c8faa3ac71a8c742 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 Dec 2015 20:04:31 +0100 Subject: 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). --- video/out/aspect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/out/aspect.c') diff --git a/video/out/aspect.c b/video/out/aspect.c index 2e1093c921..2d25bbdfd5 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -135,8 +135,8 @@ void mp_get_src_dst_rects(struct mp_log *log, struct mp_vo_opts *opts, { int src_w = video->w; int src_h = video->h; - int src_dw = video->d_w; - int src_dh = video->d_h; + int src_dw, src_dh; + mp_image_params_get_dsize(video, &src_dw, &src_dh); if (video->rotate % 180 == 90 && (vo_caps & VO_CAP_ROTATE90)) { MPSWAP(int, src_w, src_h); MPSWAP(int, src_dw, src_dh); @@ -174,8 +174,8 @@ void mp_get_src_dst_rects(struct mp_log *log, struct mp_vo_opts *opts, mp_verbose(log, "Window size: %dx%d\n", window_w, window_h); - mp_verbose(log, "Video source: %dx%d (%dx%d)\n", - video->w, video->h, video->d_w, video->d_h); + mp_verbose(log, "Video source: %dx%d (%d:%d)\n", + video->w, video->h, video->p_w, video->p_h); mp_verbose(log, "Video display: (%d, %d) %dx%d -> (%d, %d) %dx%d\n", src.x0, src.y0, sw, sh, dst.x0, dst.y0, dw, dh); mp_verbose(log, "Video scale: %f/%f\n", -- cgit v1.2.3