diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-11-17 17:54:32 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-11-17 17:54:32 +0100 |
commit | 92c07acce736c64592c4c3232b4d0dacbe2f27f7 (patch) | |
tree | 5d87a82c9d2c820c37f929a8226408e19b5a685a /libavformat/utils.c | |
parent | 0b3c23054279fe49ed550735a34cfbed67ce68cd (diff) | |
download | ffmpeg-92c07acce736c64592c4c3232b4d0dacbe2f27f7.tar.gz |
Read (display) aspect ratio from mxf files.
Fixes ticket #4107.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 39851fc571..6278668119 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3347,6 +3347,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) st->r_frame_rate.den = st->time_base.num; } } + if (st->display_aspect_ratio.num && st->display_aspect_ratio.den) { + AVRational hw_ratio = { st->codec->height, st->codec->width }; + st->sample_aspect_ratio = av_mul_q(st->display_aspect_ratio, + hw_ratio); + } } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (!st->codec->bits_per_coded_sample) st->codec->bits_per_coded_sample = |