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

Unified · Split

libavcodec/aac_ac3_parser.c+8−1
@@ -40,6 +40,8 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, · 39 unmodified lines
40 int new_frame_start;40 int new_frame_start;
41 int got_frame = 0;41 int got_frame = 0;
42 42
43 s1->key_frame = -1;
44
43 if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {45 if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
44 i = buf_size;46 i = buf_size;
45 got_frame = 1;47 got_frame = 1;
@@ -145,10 +147,15 @@ get_next: · 99 unmodified lines
145 } else {147 } else {
146#if CONFIG_AAC_PARSER148#if CONFIG_AAC_PARSER
147 AACADTSHeaderInfo hdr;149 AACADTSHeaderInfo hdr;
150 GetBitContext gb;
151 int profile;
152 init_get_bits8(&gb, buf, buf_size);
148 if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||153 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)
150 return i;155 return i;
151 156
157 avctx->profile = hdr.object_type - 1;
158 s1->key_frame = (avctx->profile == AV_PROFILE_AAC_USAC) ? get_bits1(&gb) : 1;
152 bit_rate = hdr.bit_rate;159 bit_rate = hdr.bit_rate;
153#endif160#endif
154 }161 }

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