summaryrefslogtreecommitdiff
path: root/libavcodec/g729dec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-04-17 14:29:06 +0000
committerPaul B Mahol <onemda@gmail.com>2015-04-17 19:01:58 +0000
commitdaf73d5d17012eac2f2b9bcbfc6297e2de8d8676 (patch)
treed89f392b33d9d254e29208d33456c95c49f3ea31 /libavcodec/g729dec.c
parentf98cad87590e337375f654407bcc64683a7c1294 (diff)
downloadffmpeg-daf73d5d17012eac2f2b9bcbfc6297e2de8d8676.tar.gz
avcodec/g729dec: support decoding packets with multiple frames
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/g729dec.c')
-rw-r--r--libavcodec/g729dec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 6eb057f5d8..e97677b5c9 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -421,7 +421,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
return ret;
out_frame = (int16_t*) frame->data[0];
- if (buf_size == 10) {
+ if (buf_size % 10 == 0) {
packet_type = FORMAT_G729_8K;
format = &format_g729_8k;
//Reset voice decision
@@ -711,7 +711,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
memmove(ctx->exc_base, ctx->exc_base + 2 * SUBFRAME_SIZE, (PITCH_DELAY_MAX+INTERPOL_LEN)*sizeof(int16_t));
*got_frame_ptr = 1;
- return buf_size;
+ return packet_type == FORMAT_G729_8K ? 10 : 8;
}
AVCodec ff_g729_decoder = {
@@ -722,5 +722,5 @@ AVCodec ff_g729_decoder = {
.priv_data_size = sizeof(G729Context),
.init = decoder_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
};