Set correct aspect ratio (it's sample aspect, not display aspect)

Patch by Zuxy Meng
(mail = `echo "Zuxy Meng" | tr "[A-Z] " "[a-z]." | sed "s/$/@gmail.com/"`)

Originally committed as revision 7806 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Zuxy Meng 18 years ago committed by Kostya Shishkov
parent 5a461d8e11
commit a836a2c8b2
  1. 8
      libavformat/asf.c

@ -482,11 +482,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int stream_num= asf->asfid2avid[i];
if(stream_num>=0 && dar[i].num>0 && dar[i].den>0){
AVCodecContext *codec= s->streams[stream_num]->codec;
codec->sample_aspect_ratio=
av_div_q(
dar[i],
(AVRational){codec->width, codec->height}
);
av_reduce(&codec->sample_aspect_ratio.num,
&codec->sample_aspect_ratio.den,
dar[i].num, dar[i].den, INT_MAX);
//av_log(NULL, AV_LOG_ERROR, "dar %d:%d sar=%d:%d\n", dar[i].num, dar[i].den, codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den);
}
}

Loading…
Cancel
Save