Commit a836a2c8 authored by Zuxy Meng's avatar Zuxy Meng Committed by Kostya Shishkov

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
parent 5a461d8e
...@@ -482,11 +482,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -482,11 +482,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int stream_num= asf->asfid2avid[i]; int stream_num= asf->asfid2avid[i];
if(stream_num>=0 && dar[i].num>0 && dar[i].den>0){ if(stream_num>=0 && dar[i].num>0 && dar[i].den>0){
AVCodecContext *codec= s->streams[stream_num]->codec; AVCodecContext *codec= s->streams[stream_num]->codec;
codec->sample_aspect_ratio= av_reduce(&codec->sample_aspect_ratio.num,
av_div_q( &codec->sample_aspect_ratio.den,
dar[i], dar[i].num, dar[i].den, INT_MAX);
(AVRational){codec->width, codec->height}
);
//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); //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);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment