[FFmpeg-devel] [PATCH] avcodec/aac/aacdec: set profile after decoding an audio specific config

Xiaolei Yu dreifachstein at gmail.com
Sat Nov 2 02:42:41 EET 2024


Fix the reported profile when probing an fMP4 initialization segment
---
 libavcodec/aac/aacdec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
index f6e79700d5..a779b47b39 100644
--- a/libavcodec/aac/aacdec.c
+++ b/libavcodec/aac/aacdec.c
@@ -1063,6 +1063,13 @@ static int decode_audio_specific_config_gb(AACDecContext *ac,
         return AVERROR(ENOSYS);
     }
 
+    if (m4ac->ps)
+        avctx->profile = AV_PROFILE_AAC_HE_V2;
+    else if (m4ac->ext_object_type != AOT_NULL)
+        avctx->profile = m4ac->ext_object_type - 1;
+    else
+        avctx->profile = m4ac->object_type - 1;
+
     ff_dlog(avctx,
             "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
             m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
-- 
2.45.2


More information about the ffmpeg-devel mailing list