1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

For #1636, add comments

This commit is contained in:
winlin 2020-03-13 17:05:22 +08:00
parent aa20a04abb
commit 7036f839d2
2 changed files with 10 additions and 1 deletions

View file

@ -447,6 +447,13 @@ srs_error_t SrsRawAacStream::mux_sequence_header(SrsRawAacStreamCodec* codec, st
SrsAacObjectType audioObjectType = codec->aac_object;
char channelConfiguration = codec->channel_configuration;
// Here we are generating AAC sequence header, the ASC structure,
// because we have already parsed the sampling rate from AAC codec,
// which is more precise than the sound_rate defined by RTMP.
//
// For example, AAC sampling_frequency_index is 3(48000HZ) or 4(44100HZ),
// the sound_rate is always 3(44100HZ), if we covert sound_rate to
// sampling_frequency_index, we may make mistake.
char samplingFrequencyIndex = codec->sampling_frequency_index;
if (samplingFrequencyIndex >= SrsAAcSampleRateNumbers) {
samplingFrequencyIndex = 4; // Default to 44100

View file

@ -73,12 +73,14 @@ public:
// The header of adts sample.
struct SrsRawAacStreamCodec
{
// Codec level informations.
int8_t protection_absent;
SrsAacObjectType aac_object;
int8_t sampling_frequency_index;
int8_t channel_configuration;
int16_t frame_length;
// Format level, RTMP as such, informations.
char sound_format;
char sound_rate;
char sound_size;