diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-23 20:20:36 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-23 20:20:36 +0000 |
commit | 5e4aa542defb4f9551884eec2ab09582d8c9cbc0 (patch) | |
tree | 5050e63f395309957db091714ca0f3d14198e14e | |
parent | 24d6a613e015a9d3dc0ce5a61cda210208c0eb24 (diff) | |
download | ffmpeg-5e4aa542defb4f9551884eec2ab09582d8c9cbc0.tar.gz |
reduce display aspect ratio
Originally committed as revision 16732 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/mxfenc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 10f22d5113..1e8bd7c0db 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -558,6 +558,7 @@ static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st) { ByteIOContext *pb = s->pb; int stored_height = (st->codec->height+15)/16*16; + AVRational dar; mxf_write_generic_desc(pb, st, mxf_mpegvideo_descriptor_key); @@ -567,9 +568,14 @@ static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st) mxf_write_local_tag(pb, 4, 0x3202); put_be32(pb, stored_height); + av_reduce(&dar.num, &dar.den, + st->codec->width*st->codec->sample_aspect_ratio.num, + st->codec->height*st->codec->sample_aspect_ratio.den, + 1024*1024); + mxf_write_local_tag(pb, 8, 0x320E); - put_be32(pb, st->codec->height * st->sample_aspect_ratio.den); - put_be32(pb, st->codec->width * st->sample_aspect_ratio.num); + put_be32(pb, dar.num); + put_be32(pb, dar.den); } static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st) |