On 11/19/2024 10:28 PM, Michael Niedermayer wrote:
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 <jamr...@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

Huh, the profiles not compiled with --enable-small? Weird, but ok.
Will fix.

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to