[FFmpeg-devel] [PATCH 1/3] Warn the user if lowres > max_lowres, set lowres to max_lowres and continue

Jean First jeanfirst at gmail.com
Fri Sep 30 11:42:43 CEST 2011


---
 libavcodec/utils.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a7bf93d..85022f2 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -601,10 +601,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
     }
 
     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 (avctx->codec->encode) {
         int i;
-- 
1.7.6.1



More information about the ffmpeg-devel mailing list