mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
avcodec/aac_parser: set key_frame and profile
This is in preparation for a following change. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
8ddbc26ded
commit
64bb91fd3b
@ -40,6 +40,8 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
|
||||
int new_frame_start;
|
||||
int got_frame = 0;
|
||||
|
||||
s1->key_frame = -1;
|
||||
|
||||
if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
|
||||
i = buf_size;
|
||||
got_frame = 1;
|
||||
@ -145,10 +147,15 @@ get_next:
|
||||
} else {
|
||||
#if CONFIG_AAC_PARSER
|
||||
AACADTSHeaderInfo hdr;
|
||||
GetBitContext gb;
|
||||
int profile;
|
||||
init_get_bits8(&gb, buf, buf_size);
|
||||
if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
|
||||
ff_adts_header_parse_buf(buf, &hdr) < 0)
|
||||
ff_adts_header_parse(&gb, &hdr) < 0)
|
||||
return i;
|
||||
|
||||
avctx->profile = hdr.object_type - 1;
|
||||
s1->key_frame = (avctx->profile == AV_PROFILE_AAC_USAC) ? get_bits1(&gb) : 1;
|
||||
bit_rate = hdr.bit_rate;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user