diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2019-09-16 20:57:53 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2019-09-16 20:57:53 +0200 |
commit | 551fcbbccbca8e78443c049421f01f350d4bc370 (patch) | |
tree | f71f4719dcd6375b176e2955f848485a48f436eb /libavcodec/g729_parser.c | |
parent | dc0806dd25882f41f6085c8356712f95fded56c7 (diff) |
lavc/g729dec: Support decoding Sipro ACELP.KELVIN.
Fixes ticket #4799.
Analyzed-by: Aleksandr Ustinov
Diffstat (limited to 'libavcodec/g729_parser.c')
-rw-r--r-- | libavcodec/g729_parser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/g729_parser.c b/libavcodec/g729_parser.c index 9982dbfffc..5a57025d62 100644 --- a/libavcodec/g729_parser.c +++ b/libavcodec/g729_parser.c @@ -45,9 +45,10 @@ static int g729_parse(AVCodecParserContext *s1, AVCodecContext *avctx, int next; if (!s->block_size) { - av_assert1(avctx->codec_id == AV_CODEC_ID_G729); /* FIXME: replace this heuristic block_size with more precise estimate */ s->block_size = (avctx->bit_rate < 8000) ? G729D_6K4_BLOCK_SIZE : G729_8K_BLOCK_SIZE; + if (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN) + s->block_size++; s->block_size *= avctx->channels; s->duration = avctx->frame_size; } @@ -76,7 +77,7 @@ static int g729_parse(AVCodecParserContext *s1, AVCodecContext *avctx, } AVCodecParser ff_g729_parser = { - .codec_ids = { AV_CODEC_ID_G729 }, + .codec_ids = { AV_CODEC_ID_G729, AV_CODEC_ID_ACELP_KELVIN }, .priv_data_size = sizeof(G729ParseContext), .parser_parse = g729_parse, .parser_close = ff_parse_close, |