@@ -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 "
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(-)