diff --git a/trunk/src/protocol/srs_raw_avc.cpp b/trunk/src/protocol/srs_raw_avc.cpp index f05af8221..a7c015596 100644 --- a/trunk/src/protocol/srs_raw_avc.cpp +++ b/trunk/src/protocol/srs_raw_avc.cpp @@ -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 diff --git a/trunk/src/protocol/srs_raw_avc.hpp b/trunk/src/protocol/srs_raw_avc.hpp index de81bf2ad..944fac560 100644 --- a/trunk/src/protocol/srs_raw_avc.hpp +++ b/trunk/src/protocol/srs_raw_avc.hpp @@ -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;