mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #151, use absolutely overflow to make jwplayer happy. 1.0.23
This commit is contained in:
parent
4449a8d7b0
commit
4f5cc9c403
4 changed files with 19 additions and 5 deletions
|
@ -655,10 +655,15 @@ int SrsHlsMuxer::on_sequence_header()
|
|||
bool SrsHlsMuxer::is_segment_overflow()
|
||||
{
|
||||
srs_assert(current);
|
||||
|
||||
return current->duration >= hls_fragment;
|
||||
}
|
||||
|
||||
bool SrsHlsMuxer::is_segment_absolutely_overflow()
|
||||
{
|
||||
srs_assert(current);
|
||||
return current->duration >= 2 * hls_fragment;
|
||||
}
|
||||
|
||||
int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
@ -1090,7 +1095,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
|
|||
// pure audio again for audio disabled.
|
||||
// so we reap event when the audio incoming when segment overflow.
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151
|
||||
if (muxer->is_segment_overflow()) {
|
||||
// we use absolutely overflow of segment to make jwplayer/ffplay happy
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184
|
||||
if (muxer->is_segment_absolutely_overflow()) {
|
||||
if ((ret = reap_segment("audio", muxer, af->pts)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue