mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
demux_mkv: set correct aspect ratio even if DisplayHeight is unset
Fixes the file test2.mkv from the official Matroska test file collection. libavformat does the same thing.
This commit is contained in:
parent
2182c3ffd5
commit
546ae23a0c
@ -1278,8 +1278,10 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track,
|
|||||||
if (!track->realmedia) {
|
if (!track->realmedia) {
|
||||||
sh_v->disp_w = track->v_width;
|
sh_v->disp_w = track->v_width;
|
||||||
sh_v->disp_h = track->v_height;
|
sh_v->disp_h = track->v_height;
|
||||||
if (track->v_dheight)
|
uint32_t dw = track->v_dwidth ? track->v_dwidth : track->v_width;
|
||||||
sh_v->aspect = (double) track->v_dwidth / track->v_dheight;
|
uint32_t dh = track->v_dheight ? track->v_dheight : track->v_height;
|
||||||
|
if (dw && dh)
|
||||||
|
sh_v->aspect = (double) dw / dh;
|
||||||
} else {
|
} else {
|
||||||
// vd_realvid.c will set aspect to disp_w/disp_h and rederive
|
// vd_realvid.c will set aspect to disp_w/disp_h and rederive
|
||||||
// disp_w and disp_h from the RealVideo stream contents returned
|
// disp_w and disp_h from the RealVideo stream contents returned
|
||||||
|
Loading…
Reference in New Issue
Block a user