[FFmpeg-devel] [PATCH 06/11] avcodec/aac_parser: set key_frame and profile
Michael Niedermayer
michael at niedermayer.cc
Wed Nov 20 03:28:55 EET 2024
On Sun, Nov 17, 2024 at 11:04:18PM -0300, James Almer wrote:
> This is in preparation for a following change.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> libavcodec/aac_ac3_parser.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
> index f45631d09f..2b4f92dd18 100644
> --- a/libavcodec/aac_ac3_parser.c
> +++ b/libavcodec/aac_ac3_parser.c
> @@ -25,6 +25,7 @@
> #include "libavutil/channel_layout.h"
> #include "libavutil/common.h"
> #include "parser.h"
> +#include "profiles.h"
> #include "aac_ac3_parser.h"
> #include "ac3_parser_internal.h"
> #include "adts_header.h"
> @@ -40,6 +41,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 +148,21 @@ 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;
>
> + profile = hdr.object_type - 1;
> + for (int j = 0; avctx->profile != profile &&
> + ff_aac_profiles[j].profile != AV_PROFILE_UNKNOWN; j++) {
> + if (profile != ff_aac_profiles[j].profile)
> + continue;
> + avctx->profile = profile; // ensure it's a known profile
breaks build with --enable-small
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241120/5049fc3f/attachment.sig>
More information about the ffmpeg-devel
mailing list