[FFmpeg-cvslog] lavf: don't abort if both encoder and muxer aspect ratios are not set

Rafaël Carré git at videolan.org
Mon Jun 24 11:48:55 CEST 2013


ffmpeg | branch: master | Rafaël Carré <funman at videolan.org> | Sun Jun 23 23:00:34 2013 +0200| [e21307a2b024938c6714f57c0524bdec72d607c7] | committer: Anton Khirnov

lavf: don't abort if both encoder and muxer aspect ratios are not set

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavformat/mux.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 96193dd..eb91a5c 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -187,13 +187,18 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
 
             if (av_cmp_q(st->sample_aspect_ratio,
                          codec->sample_aspect_ratio)) {
-                av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
-                                        "(%d/%d) and encoder layer (%d/%d)\n",
-                       st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
-                       codec->sample_aspect_ratio.num,
-                       codec->sample_aspect_ratio.den);
-                ret = AVERROR(EINVAL);
-                goto fail;
+                if (st->sample_aspect_ratio.num != 0 &&
+                    st->sample_aspect_ratio.den != 0 &&
+                    codec->sample_aspect_ratio.den != 0 &&
+                    codec->sample_aspect_ratio.den != 0) {
+                    av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
+                            "(%d/%d) and encoder layer (%d/%d)\n",
+                            st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
+                            codec->sample_aspect_ratio.num,
+                            codec->sample_aspect_ratio.den);
+                    ret = AVERROR(EINVAL);
+                    goto fail;
+                }
             }
             break;
         }



More information about the ffmpeg-cvslog mailing list