This is in preparation for a following change.
Unified · Split
| @@ -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_PARSER | 148 | #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 | #endif | 160 | #endif |
| 154 | } | 161 | } |