From e8d8517b160bd2dea1279d19ec0efd83e00c8c6c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 22 Sep 2011 18:17:28 +0200 Subject: [PATCH] lavf/utils: only complain about aspect missmatch when the difference is "meassureable" Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index ee6200044b..0f367b7065 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3012,7 +3012,9 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options) ret = AVERROR(EINVAL); 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 + ){ av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between encoder and muxer layer\n"); ret = AVERROR(EINVAL); goto fail;