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

Submitted by Moritz Barsnick on March 9, 2017, 9:49 a.m.

Details

Message ID 5f307fbdc6cc95abbcf1dc38b9d5b3b2066d31e5.1488989980.git.barsnick@gmx.net
State New
Headers show

Commit Message

Moritz Barsnick March 9, 2017, 9:49 a.m.
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@gmx.net>
---
 libavcodec/libfdk-aacenc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

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 "