From b63be26e9d572816c45a3d0eb9c0957ab804c7f1 Mon Sep 17 00:00:00 2001 From: igorshevach Date: Thu, 5 Sep 2024 10:00:13 +0300 Subject: [PATCH] fix: re-read object_type in case of HE-AAC --- nginx-pckg-module/src/media/codec_config.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nginx-pckg-module/src/media/codec_config.c b/nginx-pckg-module/src/media/codec_config.c index 27358472..04df1f8d 100644 --- a/nginx-pckg-module/src/media/codec_config.c +++ b/nginx-pckg-module/src/media/codec_config.c @@ -10,6 +10,10 @@ #define AOT_ESCAPE (31) +#define AOT_SBR (5) + +#define AOT_PS (29) + #define HVCC_HEADER_SIZE (22) @@ -497,6 +501,20 @@ codec_config_mp4a_config_parse( return VOD_BAD_DATA; } + if (result->object_type == AOT_SBR || result->object_type == AOT_PS ) + { + result->object_type = bit_read_stream_get(&reader, 5); + if (result->object_type == AOT_ESCAPE) + result->object_type = 32 + bit_read_stream_get(&reader, 6); + + if (reader.stream.eof_reached) + { + vod_log_error(VOD_LOG_ERR, log, 0, + "codec_config_mp4a_config_parse: failed to read all required audio extra data fields"); + return VOD_BAD_DATA; + } + } + return VOD_OK; }