This is in preparation for a following change.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -40,6 +40,8 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, · 39 unmodified lines | ||
| 40 | 40 | int new_frame_start; |
| 41 | 41 | int got_frame = 0; |
| 42 | 42 | |
| 43 | + s1->key_frame = -1; | |
| 44 | + | |
| 43 | 45 | if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) { |
| 44 | 46 | i = buf_size; |
| 45 | 47 | got_frame = 1; |
| @@ -145,10 +147,15 @@ get_next: · 99 unmodified lines | ||
| 145 | 147 | } else { |
| 146 | 148 | #if CONFIG_AAC_PARSER |
| 147 | 149 | AACADTSHeaderInfo hdr; |
| 150 | + GetBitContext gb; | |
| 151 | + int profile; | |
| 152 | + init_get_bits8(&gb, buf, buf_size); | |
| 148 | 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 | 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 | 159 | bit_rate = hdr.bit_rate; |
| 153 | 160 | #endif |
| 154 | 161 | } |