diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-01-27 06:57:11 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-01-27 06:57:11 +0000 |
commit | 74fd63d009cbf60a5fdfa6a0724508b87dd42347 (patch) | |
tree | 7c5d01f14108869bb394bc92c2767407b65805ca /libavcodec | |
parent | edab3048c29e055256f36eae6de4c8f36d49bee0 (diff) | |
download | ffmpeg-74fd63d009cbf60a5fdfa6a0724508b87dd42347.tar.gz |
Set aspect ratio if present (for AP only)
Originally committed as revision 7720 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vc1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index f08c964696..40b79b3262 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1296,12 +1296,14 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) w = get_bits(gb, 14) + 1; h = get_bits(gb, 14) + 1; av_log(v->s.avctx, AV_LOG_INFO, "Display dimensions: %ix%i\n", w, h); - //TODO: store aspect ratio in AVCodecContext if(get_bits1(gb)) ar = get_bits(gb, 4); - if(ar == 15) { + if(ar && ar < 14){ + v->s.avctx->sample_aspect_ratio = vc1_pixel_aspect[ar]; + }else if(ar == 15){ w = get_bits(gb, 8); h = get_bits(gb, 8); + v->s.avctx->sample_aspect_ratio = (AVRational){w, h}; } if(get_bits1(gb)){ //framerate stuff |