lavf/utils: only complain about aspect missmatch when the difference is "meassureable"
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Sep 2011 16:17:28 +0000 (18:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 1 Oct 2011 17:30:49 +0000 (19:30 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8d8517b160bd2dea1279d19ec0efd83e00c8c6c)

libavformat/utils.c

index 40f0089..eaa8bd9 100644 (file)
@@ -2958,7 +2958,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;