changeset 8289:e4877f9fc823 libavcodec

Avoid the 'Claimed bitrate and buffer size mismatch' warning storm. - Patch by Kenan Gillet
author reynaldo
date Thu, 11 Dec 2008 00:11:02 +0000
parents 800444234375
children f664577ac17d
files qcelpdec.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/qcelpdec.c	Wed Dec 10 21:35:17 2008 +0000
+++ b/qcelpdec.c	Thu Dec 11 00:11:02 2008 +0000
@@ -71,6 +71,7 @@
     float    pitch_gain[4];
     uint8_t  pitch_lag[4];
     uint16_t first16bits;
+    uint8_t  warned_buf_mismatch_bitrate;
 } QCELPContext;
 
 /**
@@ -636,8 +637,13 @@
     {
         if(bitrate > **buf)
         {
+            QCELPContext *q = avctx->priv_data;
+            if (!q->warned_buf_mismatch_bitrate)
+            {
             av_log(avctx, AV_LOG_WARNING,
                    "Claimed bitrate and buffer size mismatch.\n");
+                q->warned_buf_mismatch_bitrate = 1;
+            }
             bitrate = **buf;
         }else if(bitrate < **buf)
         {