1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00

refine code, write audio immediatly

This commit is contained in:
winlin 2013-11-26 10:56:29 +08:00
parent dbdfb29de1
commit 501b182dc9

4
trunk/src/core/srs_core_hls.cpp Executable file → Normal file
View file

@ -579,12 +579,9 @@ int SrsTSMuxer::write_audio(u_int32_t time, SrsCodec* codec, SrsCodecSample* sam
{
int ret = ERROR_SUCCESS;
if (!audio_frame) {
audio_frame = new SrsMpegtsFrame();
audio_frame->dts = audio_frame->pts = time * 90;
audio_frame->pid = TS_AUDIO_PID;
audio_frame->sid = TS_AUDIO_AAC;
}
for (int i = 0; i < sample->nb_buffers; i++) {
SrsCodecBuffer* buf = &sample->buffers[i];
@ -649,7 +646,6 @@ int SrsTSMuxer::write_audio(u_int32_t time, SrsCodec* codec, SrsCodecSample* sam
if ((ret = SrsMpegtsWriter::write_frame(fd, audio_frame, audio_buffer)) != ERROR_SUCCESS) {
return ret;
}
srs_freep(audio_frame);
return ret;
}