History

avcodec/aac_parser: set key_frame and profile

This is in preparation for a following change.

James Almer committed 1 year ago

Commit 64bb91f1 parent 8ddbc261 file · +8 −1Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/aac_ac3_parser.c+8−1
@@ -40,6 +40,8 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, · 39 unmodified lines
4040 int new_frame_start;
4141 int got_frame = 0;
4242
43+ s1->key_frame = -1;
44+
4345 if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
4446 i = buf_size;
4547 got_frame = 1;
@@ -145,10 +147,15 @@ get_next: · 99 unmodified lines
145147 } else {
146148 #if CONFIG_AAC_PARSER
147149 AACADTSHeaderInfo hdr;
150+ GetBitContext gb;
151+ int profile;
152+ init_get_bits8(&gb, buf, buf_size);
148153 if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
149− ff_adts_header_parse_buf(buf, &hdr) < 0)
154+ ff_adts_header_parse(&gb, &hdr) < 0)
150155 return i;
151156
157+ avctx->profile = hdr.object_type - 1;
158+ s1->key_frame = (avctx->profile == AV_PROFILE_AAC_USAC) ? get_bits1(&gb) : 1;
152159 bit_rate = hdr.bit_rate;
153160 #endif
154161 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t