diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-09 16:09:53 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-20 12:06:31 +0200 |
commit | 12ded9cd85be60d9622c438d9a8cfc099028c960 (patch) | |
tree | 9dc75e5e8e25c30c41504531556aa2cbca865b91 /libavcodec/ftr_parser.c | |
parent | ae937c49027fab3b5f34397e04ee7aa22d9ae40f (diff) | |
download | ffmpeg-12ded9cd85be60d9622c438d9a8cfc099028c960.tar.gz |
avcodec/adts_header: Add ff_adts_header_parse_buf()
Most users of ff_adts_header_parse() don't already have
an opened GetBitContext for the header, so add a convenience
function for them.
Also use a forward declaration of GetBitContext in adts_header.h
as this avoids (implicit) inclusion of get_bits.h in some of
the users that now no longer use a GetBitContext of their own.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ftr_parser.c')
-rw-r--r-- | libavcodec/ftr_parser.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/ftr_parser.c b/libavcodec/ftr_parser.c index 05e6cfed98..656fd289f6 100644 --- a/libavcodec/ftr_parser.c +++ b/libavcodec/ftr_parser.c @@ -25,7 +25,6 @@ */ #include "parser.h" -#include "get_bits.h" #include "adts_header.h" #include "adts_parser.h" #include "mpeg4audio.h" @@ -45,7 +44,6 @@ static int ftr_parse(AVCodecParserContext *s, AVCodecContext *avctx, FTRParseContext *ftr = s->priv_data; uint64_t state = ftr->pc.state64; int next = END_NOT_FOUND; - GetBitContext bits; AACADTSHeaderInfo hdr; int size; @@ -71,10 +69,9 @@ static int ftr_parse(AVCodecParserContext *s, AVCodecContext *avctx, state = (state << 8) | buf[i]; AV_WB64(tmp, state); - init_get_bits(&bits, tmp + 8 - AV_AAC_ADTS_HEADER_SIZE, - AV_AAC_ADTS_HEADER_SIZE * 8); + size = ff_adts_header_parse_buf(tmp + 8 - AV_AAC_ADTS_HEADER_SIZE, &hdr); - if ((size = ff_adts_header_parse(&bits, &hdr)) > 0) { + if (size > 0) { ftr->skip = size - 6; ftr->frame_index += ff_mpeg4audio_channels[hdr.chan_config]; if (ftr->frame_index >= avctx->ch_layout.nb_channels) { |