mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #301, User must config the codec in right way for HLS. 3.0.18
This commit is contained in:
parent
d612a21bad
commit
2a4f57a587
6 changed files with 6 additions and 60 deletions
|
@ -2740,12 +2740,6 @@ int SrsTsMuxer::open(string p)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsTsMuxer::update_acodec(SrsAudioCodecId ac)
|
||||
{
|
||||
acodec = ac;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
int SrsTsMuxer::write_audio(SrsTsMessage* audio)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
@ -3117,6 +3111,7 @@ int SrsTsEncoder::initialize(SrsFileWriter* fw)
|
|||
writer = fw;
|
||||
|
||||
srs_freep(muxer);
|
||||
// TODO: FIXME: Support config the codec.
|
||||
muxer = new SrsTsMuxer(fw, context, SrsAudioCodecIdAAC, SrsVideoCodecIdAVC);
|
||||
|
||||
if ((ret = muxer->open("")) != ERROR_SUCCESS) {
|
||||
|
@ -3139,12 +3134,6 @@ int SrsTsEncoder::write_audio(int64_t timestamp, char* data, int size)
|
|||
if (format->acodec->id != SrsAudioCodecIdAAC && format->acodec->id != SrsAudioCodecIdMP3) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// when codec changed, write new header.
|
||||
if ((ret = muxer->update_acodec(format->acodec->id)) != ERROR_SUCCESS) {
|
||||
srs_error("http: ts audio write header failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// for aac: ignore sequence header
|
||||
if (format->acodec->id == SrsAudioCodecIdAAC && format->audio->aac_packet_type == SrsAudioAacFrameTraitSequenceHeader) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue