Fallbacks will be added for when bit allocation fails. This message
will only be logged if the fallbacks also fail.
---
 libavcodec/ac3enc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git libavcodec/ac3enc.c libavcodec/ac3enc.c
index 022de2b..1652e0e 100644
--- libavcodec/ac3enc.c
+++ libavcodec/ac3enc.c
@@ -705,7 +705,6 @@ static int compute_bit_allocation(AC3EncodeContext *s,
            bit_alloc(s, mask, psd, bap, frame_bits, snr_offset) < 0)
         snr_offset -= 64;
     if (snr_offset < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
         return -1;
     }
     while ((snr_offset + 64) <= 1023 &&
@@ -1317,8 +1316,10 @@ static int AC3_encode_frame(AVCodecContext *avctx,
 
     process_exponents(s, mdct_coef, exp, exp_strategy, exp_shift, &frame_bits);
 
-    if (compute_bit_allocation(s, bap, exp, exp_strategy, frame_bits))
+    if (compute_bit_allocation(s, bap, exp, exp_strategy, frame_bits)) {
+        av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
         return AVERROR(EINVAL);
+    }
     /* everything is known... let's output the frame */
     output_frame_header(s, frame);
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to