aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-12-20 09:36:56 +0100
committerGravatar wm4 <wm4@nowhere>2015-12-20 09:36:56 +0100
commit127da1613ffa3cd3da5e8981e4a0acc08c5dd063 (patch)
tree187c8330ed29ff5f59e1bb092c3d6ef90c62074e /demux
parentc01935986c68288ae5ad82e68cac0744740d8a0a (diff)
demux_disc: fix aspect ratio
Broken by commit 0a0bb905. STREAM_CTRL_GET_ASPECT_RATIO returns a display aspect ratio, not a pixel aspect ratio.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_disc.c8
1 files changed, 6 insertions, 2 deletions
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)