From 127da1613ffa3cd3da5e8981e4a0acc08c5dd063 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 20 Dec 2015 09:36:56 +0100 Subject: demux_disc: fix aspect ratio Broken by commit 0a0bb905. STREAM_CTRL_GET_ASPECT_RATIO returns a display aspect ratio, not a pixel aspect ratio. --- demux/demux_disc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'demux') diff --git a/demux/demux_disc.c b/demux/demux_disc.c index 4c27393f5c..66079082d2 100644 --- a/demux/demux_disc.c +++ b/demux/demux_disc.c @@ -23,6 +23,7 @@ #include "common/msg.h" #include "stream/stream.h" +#include "video/mp_image.h" #include "demux.h" #include "stheader.h" @@ -148,8 +149,11 @@ static void add_streams(demuxer_t *demuxer) if (stream_control(demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar) == STREAM_OK) { - sh->video->par_w = 1728 * ar; // being lazy here - sh->video->par_h = 1728 / ar; + struct mp_image_params f = {.w = sh->video->disp_w * 1728, + .h = sh->video->disp_h * 1728}; + mp_image_params_set_dsize(&f, f.w * ar, f.h / ar); + sh->video->par_w = f.p_w; + sh->video->par_h = f.p_h; } } if (src->audio) -- cgit v1.2.3