mirror of
https://github.com/mpv-player/mpv
synced 2025-05-07 10:40:33 +00:00
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:
parent
c01935986c
commit
127da1613f
@ -23,6 +23,7 @@
|
|||||||
#include "common/msg.h"
|
#include "common/msg.h"
|
||||||
|
|
||||||
#include "stream/stream.h"
|
#include "stream/stream.h"
|
||||||
|
#include "video/mp_image.h"
|
||||||
#include "demux.h"
|
#include "demux.h"
|
||||||
#include "stheader.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)
|
if (stream_control(demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar)
|
||||||
== STREAM_OK)
|
== STREAM_OK)
|
||||||
{
|
{
|
||||||
sh->video->par_w = 1728 * ar; // being lazy here
|
struct mp_image_params f = {.w = sh->video->disp_w * 1728,
|
||||||
sh->video->par_h = 1728 / ar;
|
.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)
|
if (src->audio)
|
||||||
|
Loading…
Reference in New Issue
Block a user