Commit 85ea5c6e authored by Michael Niedermayer's avatar Michael Niedermayer

lavf/utils: fix overestimation of the rational number density.

Fixes Ticket498
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bf5c3bac
...@@ -3016,7 +3016,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options) ...@@ -3016,7 +3016,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
goto fail; goto fail;
} }
if(av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio) if(av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)
&& FFABS(av_q2d(st->sample_aspect_ratio) - av_q2d(st->codec->sample_aspect_ratio)) > 0.001 && FFABS(av_q2d(st->sample_aspect_ratio) - av_q2d(st->codec->sample_aspect_ratio)) > 0.004*av_q2d(st->sample_aspect_ratio)
){ ){
av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between encoder and muxer layer\n"); av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between encoder and muxer layer\n");
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
......
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