# HG changeset patch # User michael # Date 1143023601 0 # Node ID 5661350bf2141218111dbed8f88e0871bbc41d30 # Parent 32cfbb9cdbdd653b797242c3a9e9d9fd314a7421 fix aspect ratio diff -r 32cfbb9cdbdd -r 5661350bf214 matroska.c --- a/matroska.c Tue Mar 21 18:32:58 2006 +0000 +++ b/matroska.c Wed Mar 22 10:33:21 2006 +0000 @@ -2272,18 +2272,14 @@ 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;