diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:43:20 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:43:20 +0000 |
commit | 5972945197d44e8bde6a986b9cba2e8196cfbc9c (patch) | |
tree | 94ba719e6f5efb53fc18d7eb38ccb96d25e7b194 /libavformat/matroskaenc.c | |
parent | c30a4489b444020ef951c1f0583afd8679c07c78 (diff) | |
download | ffmpeg-5972945197d44e8bde6a986b9cba2e8196cfbc9c.tar.gz |
convert every muxer/demuxer to write/read sample_aspect_ratio from/to
the corresponding AVStream instead of AVCodecContext
Originally committed as revision 14933 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index e656bc3c3d..9346e9c84e 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -593,11 +593,10 @@ static int mkv_write_tracks(AVFormatContext *s) // XXX: interlace flag? put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELWIDTH , codec->width); put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELHEIGHT, codec->height); - if (codec->sample_aspect_ratio.num) { - AVRational dar = av_mul_q(codec->sample_aspect_ratio, - (AVRational){codec->width, codec->height}); - put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , dar.num); - put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, dar.den); + if (st->sample_aspect_ratio.num) { + int d_width = codec->width*av_q2d(st->sample_aspect_ratio); + put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width); + put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, codec->height); } end_ebml_master(pb, subinfo); break; |