mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #304, do not add deviation for absolute overflow.
This commit is contained in:
parent
77c29da26b
commit
4329366c08
1 changed files with 2 additions and 6 deletions
|
@ -487,11 +487,7 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow()
|
||||||
{
|
{
|
||||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-83553950
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-83553950
|
||||||
srs_assert(current);
|
srs_assert(current);
|
||||||
|
return current->duration >= hls_aof_ratio * hls_fragment;
|
||||||
// use N% deviation, to smoother.
|
|
||||||
double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * hls_fragment_deviation : 0.0;
|
|
||||||
|
|
||||||
return current->duration >= hls_aof_ratio * (hls_fragment + deviation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsHlsMuxer::update_acodec(SrsCodecAudio ac)
|
int SrsHlsMuxer::update_acodec(SrsCodecAudio ac)
|
||||||
|
@ -922,7 +918,7 @@ int SrsHlsCache::write_video(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
|
||||||
// 2. some gops duration overflow.
|
// 2. some gops duration overflow.
|
||||||
if (sample->frame_type == SrsCodecVideoAVCFrameKeyFrame && muxer->is_segment_overflow()) {
|
if (sample->frame_type == SrsCodecVideoAVCFrameKeyFrame && muxer->is_segment_overflow()) {
|
||||||
if (!sample->has_idr) {
|
if (!sample->has_idr) {
|
||||||
srs_warn("hls: ts starts without IDR, first nalu=%d", sample->first_nalu_type);
|
srs_warn("hls: ts starts without IDR, first nalu=%d, idr=%d", sample->first_nalu_type, sample->has_idr);
|
||||||
}
|
}
|
||||||
if ((ret = reap_segment("video", muxer, cache->video->dts)) != ERROR_SUCCESS) {
|
if ((ret = reap_segment("video", muxer, cache->video->dts)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue