# HG changeset patch # User kostya # Date 1169881031 0 # Node ID 7c42c51b113010095ce6887a6f93dcc94cbba03a # Parent 371bb9f644dab4245d602e4f79276abb77e3ef21 Set aspect ratio if present (for AP only) diff -r 371bb9f644da -r 7c42c51b1130 vc1.c --- a/vc1.c Fri Jan 26 15:26:08 2007 +0000 +++ b/vc1.c Sat Jan 27 06:57:11 2007 +0000 @@ -1296,12 +1296,14 @@ 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