[FFmpeg-cvslog] lavf/utils: only complain about aspect missmatch when the difference is " meassureable"

Michael Niedermayer git at videolan.org
Sat Oct 1 21:38:47 CEST 2011


ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 22 18:17:28 2011 +0200| [3aad92f3e649dcc4f92c805291afb128c663efd3] | committer: Michael Niedermayer

lavf/utils: only complain about aspect missmatch when the difference is "meassureable"

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit e8d8517b160bd2dea1279d19ec0efd83e00c8c6c)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3aad92f3e649dcc4f92c805291afb128c663efd3
---

 libavformat/utils.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 40f0089..eaa8bd9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list