diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-01 04:13:06 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-01 05:38:40 +0400 |
commit | 9c1f0493d5582f2c7b12dd16b70062cf233066b0 (patch) | |
tree | 9145be74d74952829d2aa34a2908a8e91c2be0bb /libavcodec | |
parent | 099d6813c27faf95257a529aa2c65dfde816a487 (diff) |
Revert 464f26889c99f194d112fcf1197795d341fad38b
The code is not needed for us and it doesnt work completely.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 69232ed9b6..77a7cd95e7 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1439,27 +1439,25 @@ static int mp_decode_layer3(MPADecodeContext *s) #if !UNCHECKED_BITSTREAM_READER s->gb.size_in_bits_plus8 += EXTRABYTES * 8; #endif - s->last_buf_size <<= 3; - for (gr = 0, ch = 0; gr < nb_granules && (s->last_buf_size >> 3) < main_data_begin; gr++, ch = 0) { - for (; ch < s->nb_channels && (s->last_buf_size >> 3) < main_data_begin; ch++) { - g = &s->granules[ch][gr]; - s->last_buf_size += g->part2_3_length; - memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid)); - } - } - skip_bits_long(&s->gb, s->last_buf_size - 8 * main_data_begin); - if (get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer) { - skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits); - s->gb = s->in_gb; - s->in_gb.buffer = NULL; - } - } else { - gr = ch = 0; + skip_bits_long(&s->gb, 8*(s->last_buf_size - main_data_begin)); } - for (; gr < nb_granules; gr++, ch = 0) { - for (; ch < s->nb_channels; ch++) { + for (gr = 0; gr < nb_granules; gr++) { + for (ch = 0; ch < s->nb_channels; ch++) { g = &s->granules[ch][gr]; + if (get_bits_count(&s->gb) < 0) { + av_log(s->avctx, AV_LOG_DEBUG, "mdb:%d, lastbuf:%d skipping granule %d\n", + main_data_begin, s->last_buf_size, gr); + skip_bits_long(&s->gb, g->part2_3_length); + memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid)); + if (get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer) { + skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits); + s->gb = s->in_gb; + s->in_gb.buffer = NULL; + } + continue; + } + bits_pos = get_bits_count(&s->gb); if (!s->lsf) { |