aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2016-08-04 15:35:57 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-12 16:34:20 +0200
commitb5f30fe8fea586545b140abbd0602188b09d3133 (patch)
tree13817f1e26480f3c4a0931666ad0b6d964d1c69d
parente8b355a0288ce8f575cc12cce7e7b7b0dae62525 (diff)
downloadffmpeg-b5f30fe8fea586545b140abbd0602188b09d3133.tar.gz
avcodec/utils: only warn when passed invalid lowres value
This makes it easier to use the lowres option when dealing with input files in different codecs. If the codec doesn't support lowres=1 for instance, it will throw a warning and use lowres=0 instead of erroring out completely. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f7adb525f8..783f62c235 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1389,10 +1389,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avctx->thread_count = 1;
if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
- av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+ av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
avctx->codec->max_lowres);
- ret = AVERROR(EINVAL);
- goto free_and_end;
+ avctx->lowres = avctx->codec->max_lowres;
}
#if FF_API_VISMV