diff options
author | Rafaël Carré <funman@videolan.org> | 2013-06-24 01:00:34 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-06-24 10:03:26 +0400 |
commit | e21307a2b024938c6714f57c0524bdec72d607c7 (patch) | |
tree | a6ac0fef62dfa4026cce14320578f2c43684a298 /libavformat/mux.c | |
parent | c3e58f8fb75d8467161a65b85eb88281547ebab1 (diff) |
lavf: don't abort if both encoder and muxer aspect ratios are not set
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index 96193dd9a6..eb91a5ccd3 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; } |