Skip to content

Commit

Permalink
for bug ossrs#293, support aac stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 18, 2015
1 parent 3244c08 commit 15d8753
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trunk/src/kernel/srs_kernel_aac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size)
}

// the left is the aac raw frame data.
int16_t aac_frame_length = stream->size() - stream->pos();
int16_t aac_raw_length = stream->size() - stream->pos();

// write the ADTS header.
// @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75,
Expand All @@ -169,6 +169,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size)
char aac_fixed_header[7];
if(true) {
char* pp = aac_fixed_header;
int16_t aac_frame_length = aac_raw_length + 7;

// Syncword 12 bslbf
*pp++ = 0xff;
Expand Down Expand Up @@ -212,7 +213,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size)
}

// write aac frame body.
if ((ret = _fs->write(data + stream->pos(), aac_frame_length, NULL)) != ERROR_SUCCESS) {
if ((ret = _fs->write(data + stream->pos(), aac_raw_length, NULL)) != ERROR_SUCCESS) {
return ret;
}

Expand Down

0 comments on commit 15d8753

Please sign in to comment.