diff options
author | Sascha Sommer <saschasommer@freenet.de> | 2009-09-11 19:59:27 +0400 |
---|---|---|
committer | Sascha Sommer <saschasommer@freenet.de> | 2009-09-11 19:59:27 +0400 |
commit | bc7f96b1845d985a76cc2a7a580dc4d5e5d8a9c3 (patch) | |
tree | 99a574599324d896d00d65a79699f37ce938b00d /libavcodec/wmaprodec.c | |
parent | 6fa6c481b91f833c212d88e6206e088aad8437d8 (diff) |
reinit get_bits for every decode_packet call
Originally committed as revision 19822 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r-- | libavcodec/wmaprodec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 8f248629c8..425cc0ba75 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -190,6 +190,7 @@ typedef struct WMAProDecodeCtx { /* packet decode state */ GetBitContext pgb; ///< bitstream reader context for the packet + uint8_t packet_offset; ///< frame offset in the packet uint8_t packet_sequence_number; ///< current packet number int num_saved_bits; ///< saved number of bits int frame_offset; ///< frame offset in the bit reservoir @@ -1502,6 +1503,9 @@ static int decode_packet(AVCodecContext *avctx, } else { int frame_size; + s->buf_bit_size = avpkt->size << 3; + init_get_bits(gb, avpkt->data, s->buf_bit_size); + skip_bits(gb, s->packet_offset); if (remaining_bits(s, gb) > s->log2_frame_size && (frame_size = show_bits(gb, s->log2_frame_size)) && frame_size <= remaining_bits(s, gb)) { @@ -1519,8 +1523,9 @@ static int decode_packet(AVCodecContext *avctx, } *data_size = (int8_t *)s->samples - (int8_t *)data; + s->packet_offset = get_bits_count(gb) & 7; - return (!s->packet_done && !s->packet_loss)?0: avctx->block_align; + return get_bits_count(gb) >> 3; } /** |