Partially revert "avformat/matroskadec: set aspect ratio only when DisplayWidth and...
authorJames Almer <jamrial@gmail.com>
Sun, 16 Oct 2016 13:13:45 +0000 (10:13 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 16 Oct 2016 17:19:05 +0000 (14:19 -0300)
The code works just fine regardless of unit, so only make sure DisplayUnit
is not "unknown".

Found-by: Nicolas George <george@nsup.org>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/matroskadec.c

index 0d17a7e..8847c62 100644 (file)
@@ -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,