diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-03-22 10:33:21 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-03-22 10:33:21 +0000 |
commit | 68ca39b21ab56ae1101b39a4b3113bf3b337e191 (patch) | |
tree | 574dd8133406219dae139d76301b7a5054fb2118 /libavformat | |
parent | 2c9a0285d499b2e525d465c4cbc3fcb7088b65ab (diff) | |
download | ffmpeg-68ca39b21ab56ae1101b39a4b3113bf3b337e191.tar.gz |
fix aspect ratio
Originally committed as revision 5192 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroska.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/libavformat/matroska.c b/libavformat/matroska.c index 699c043996..2c92431e71 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -2272,18 +2272,14 @@ matroska_read_header (AVFormatContext *s, st->codec->width = videotrack->pixel_width; st->codec->height = videotrack->pixel_height; if (videotrack->display_width == 0) - st->codec->sample_aspect_ratio.num = - videotrack->pixel_width; - else - st->codec->sample_aspect_ratio.num = - videotrack->display_width; + videotrack->display_width= videotrack->pixel_width; if (videotrack->display_height == 0) - st->codec->sample_aspect_ratio.num = - videotrack->pixel_height; - else - st->codec->sample_aspect_ratio.num = - videotrack->display_height; - + videotrack->display_height= videotrack->pixel_height; + av_reduce(&st->codec->sample_aspect_ratio.num, + &st->codec->sample_aspect_ratio.den, + st->codec->height * videotrack->display_width, + st->codec-> width * videotrack->display_height, + 255); } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { MatroskaAudioTrack *audiotrack = (MatroskaAudioTrack *)track; |