Mercurial > libavcodec.hg
comparison qcelpdec.c @ 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 | f93efc084e41 |
children | c7e800518b8b |
comparison
equal
deleted
inserted
replaced
8288:800444234375 | 8289:e4877f9fc823 |
---|---|
69 int prev_g1[2]; | 69 int prev_g1[2]; |
70 int prev_bitrate; | 70 int prev_bitrate; |
71 float pitch_gain[4]; | 71 float pitch_gain[4]; |
72 uint8_t pitch_lag[4]; | 72 uint8_t pitch_lag[4]; |
73 uint16_t first16bits; | 73 uint16_t first16bits; |
74 uint8_t warned_buf_mismatch_bitrate; | |
74 } QCELPContext; | 75 } QCELPContext; |
75 | 76 |
76 /** | 77 /** |
77 * Reconstructs LPC coefficients from the line spectral pair frequencies. | 78 * Reconstructs LPC coefficients from the line spectral pair frequencies. |
78 * | 79 * |
634 | 635 |
635 if((bitrate = buf_size2bitrate(buf_size)) >= 0) | 636 if((bitrate = buf_size2bitrate(buf_size)) >= 0) |
636 { | 637 { |
637 if(bitrate > **buf) | 638 if(bitrate > **buf) |
638 { | 639 { |
640 QCELPContext *q = avctx->priv_data; | |
641 if (!q->warned_buf_mismatch_bitrate) | |
642 { | |
639 av_log(avctx, AV_LOG_WARNING, | 643 av_log(avctx, AV_LOG_WARNING, |
640 "Claimed bitrate and buffer size mismatch.\n"); | 644 "Claimed bitrate and buffer size mismatch.\n"); |
645 q->warned_buf_mismatch_bitrate = 1; | |
646 } | |
641 bitrate = **buf; | 647 bitrate = **buf; |
642 }else if(bitrate < **buf) | 648 }else if(bitrate < **buf) |
643 { | 649 { |
644 av_log(avctx, AV_LOG_ERROR, | 650 av_log(avctx, AV_LOG_ERROR, |
645 "Buffer is too small for the claimed bitrate.\n"); | 651 "Buffer is too small for the claimed bitrate.\n"); |