From 8b59ce0342684a9b2fb0f87d6f191f33a8136619 Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 16 Oct 2016 10:13:45 -0300 Subject: [PATCH] Partially revert "avformat/matroskadec: set aspect ratio only when DisplayWidth and DisplayHeight are in pixels" The code works just fine regardless of unit, so only make sure DisplayUnit is not "unknown". Found-by: Nicolas George Reviewed-by: Nicolas George Signed-off-by: James Almer --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0d17a7ef24..8847c62e32 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2297,7 +2297,7 @@ static int matroska_parse_tracks(AVFormatContext *s) if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREOMODE_TYPE_NB) mkv_stereo_mode_display_mul(track->video.stereo_mode, &display_width_mul, &display_height_mul); - if (track->video.display_unit == MATROSKA_VIDEO_DISPLAYUNIT_PIXELS) { + if (track->video.display_unit < MATROSKA_VIDEO_DISPLAYUNIT_UNKNOWN) { av_reduce(&st->sample_aspect_ratio.num, &st->sample_aspect_ratio.den, st->codecpar->height * track->video.display_width * display_width_mul,