Commit 8b59ce03 authored by James Almer's avatar James Almer

Partially revert "avformat/matroskadec: set aspect ratio only when...

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: 's avatarNicolas George <george@nsup.org>
Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 4b0f37da
...@@ -2297,7 +2297,7 @@ static int matroska_parse_tracks(AVFormatContext *s) ...@@ -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) 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); 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, av_reduce(&st->sample_aspect_ratio.num,
&st->sample_aspect_ratio.den, &st->sample_aspect_ratio.den,
st->codecpar->height * track->video.display_width * display_width_mul, st->codecpar->height * track->video.display_width * display_width_mul,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment