[FFmpeg-devel] [PATCH 1/2] lavc/libfdk-aacenc: make message clearer about action taken

Moritz Barsnick barsnick at gmx.net
Thu Mar 9 11:49:34 EET 2017


A user option is being checked and adjusted, don't just warn about
about the failed range check, but also mention the adjustment.

Signed-off-by: Moritz Barsnick <barsnick at gmx.net>
---
 libavcodec/libfdk-aacenc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 98a817b..5f84fb2 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -185,11 +185,12 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
     }
 
     if (avctx->flags & AV_CODEC_FLAG_QSCALE || s->vbr) {
-        int mode = s->vbr ? s->vbr : avctx->global_quality;
+        int modenew, mode = s->vbr ? s->vbr : avctx->global_quality;
         if (mode <  1 || mode > 5) {
+            modenew = av_clip(mode, 1, 5);
             av_log(avctx, AV_LOG_WARNING,
-                   "VBR quality %d out of range, should be 1-5\n", mode);
-            mode = av_clip(mode, 1, 5);
+                   "VBR quality %d is out of range, should be 1-5, using %d\n", mode, modenew);
+            mode = modenew;
         }
         av_log(avctx, AV_LOG_WARNING,
                "Note, the VBR setting is unsupported and only works with "
-- 
2.9.3



More information about the ffmpeg-devel mailing list