Commit e21307a2 authored by Rafaël Carré's avatar Rafaël Carré Committed by Anton Khirnov

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

Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent c3e58f8f
...@@ -187,6 +187,10 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options) ...@@ -187,6 +187,10 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
if (av_cmp_q(st->sample_aspect_ratio, if (av_cmp_q(st->sample_aspect_ratio,
codec->sample_aspect_ratio)) { codec->sample_aspect_ratio)) {
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 " av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
"(%d/%d) and encoder layer (%d/%d)\n", "(%d/%d) and encoder layer (%d/%d)\n",
st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
...@@ -195,6 +199,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options) ...@@ -195,6 +199,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto fail; goto fail;
} }
}
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment