mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
fix the hls_dispose bug, ignore for 0.
This commit is contained in:
parent
56938efdbd
commit
0d6a574216
1 changed files with 7 additions and 2 deletions
|
@ -950,6 +950,8 @@ int SrsHlsCache::on_publish(SrsHlsMuxer* muxer, SrsRequest* req, int64_t segment
|
|||
double hls_aof_ratio = _srs_config->get_hls_aof_ratio(vhost);
|
||||
// whether use floor(timestamp/hls_fragment) for variable timestamp
|
||||
bool ts_floor = _srs_config->get_hls_ts_floor(vhost);
|
||||
// the seconds to dispose the hls.
|
||||
int hls_dispose = _srs_config->get_hls_dispose(vhost);
|
||||
|
||||
// TODO: FIXME: support load exists m3u8, to continue publish stream.
|
||||
// for the HLS donot requires the EXT-X-MEDIA-SEQUENCE be monotonically increase.
|
||||
|
@ -967,9 +969,9 @@ int SrsHlsCache::on_publish(SrsHlsMuxer* muxer, SrsRequest* req, int64_t segment
|
|||
srs_error("m3u8 muxer open segment failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_trace("hls: win=%.2f, frag=%.2f, prefix=%s, path=%s, m3u8=%s, ts=%s, aof=%.2f, floor=%d, clean=%d, waitk=%d",
|
||||
srs_trace("hls: win=%.2f, frag=%.2f, prefix=%s, path=%s, m3u8=%s, ts=%s, aof=%.2f, floor=%d, clean=%d, waitk=%d, dispose=%d",
|
||||
hls_window, hls_fragment, entry_prefix.c_str(), path.c_str(), m3u8_file.c_str(),
|
||||
ts_file.c_str(), hls_aof_ratio, ts_floor, cleanup, wait_keyframe);
|
||||
ts_file.c_str(), hls_aof_ratio, ts_floor, cleanup, wait_keyframe, hls_dispose);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1188,6 +1190,9 @@ int SrsHls::cycle()
|
|||
}
|
||||
|
||||
int hls_dispose = _srs_config->get_hls_dispose(_req->vhost) * 1000;
|
||||
if (hls_dispose <= 0) {
|
||||
return ret;
|
||||
}
|
||||
if (srs_get_system_time_ms() - last_update_time <= hls_dispose) {
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue