demux_disc: fix aspect ratio

Broken by commit 0a0bb905. STREAM_CTRL_GET_ASPECT_RATIO returns a
display aspect ratio, not a pixel aspect ratio.
This commit is contained in:
wm4 2015-12-20 09:36:56 +01:00
parent c01935986c
commit 127da1613f
1 changed files with 6 additions and 2 deletions

View File

@ -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)