Skip to content

Commit

Permalink
fix: re-read object_type in case of HE-AAC
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshevach committed Sep 5, 2024
1 parent 44031d2 commit b63be26
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions nginx-pckg-module/src/media/codec_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

#define AOT_ESCAPE (31)

#define AOT_SBR (5)

#define AOT_PS (29)

#define HVCC_HEADER_SIZE (22)


Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b63be26

Please sign in to comment.