提交 45e5d0c3 编写于 作者: J Justin Ruggles

libspeexdec: properly handle DTX for multiple frames-per-packet

上级 908e22b9
...@@ -119,10 +119,12 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data, ...@@ -119,10 +119,12 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
} }
output = (int16_t *)s->frame.data[0]; output = (int16_t *)s->frame.data[0];
/* if there is not enough data left for the smallest possible frame, /* if there is not enough data left for the smallest possible frame or the
reset the libspeex buffer using the current packet, otherwise ignore next 5 bits are a terminator code, reset the libspeex buffer using the
the current packet and keep decoding frames from the libspeex buffer. */ current packet, otherwise ignore the current packet and keep decoding
if (speex_bits_remaining(&s->bits) < 43) { frames from the libspeex buffer. */
if (speex_bits_remaining(&s->bits) < 5 ||
speex_bits_peek_unsigned(&s->bits, 5) == 0x1F) {
/* check for flush packet */ /* check for flush packet */
if (!buf || !buf_size) { if (!buf || !buf_size) {
*got_frame_ptr = 0; *got_frame_ptr = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册