Skip to content

Commit 15d8753

Browse files
committed
for bug ossrs#293, support aac stream.
1 parent 3244c08 commit 15d8753

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

trunk/src/kernel/srs_kernel_aac.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int SrsAacEncoder::write_audio(int64_t timestamp, char* data, int size)
145145
}
146146

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

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

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

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

0 commit comments

Comments
 (0)