livesource dispose: fix hls/dash cleanup_delay() and cycle()

pull/4161/head
Jacob Su 4 months ago
parent ab94d425f7
commit 90e0131dc0

@ -703,10 +703,6 @@ void SrsDash::dispose()
srs_error_t SrsDash::cycle()
{
srs_error_t err = srs_success;
if (!enabled) {
return err;
}
if (last_update_time_ <= 0) {
last_update_time_ = srs_get_system_time();
@ -738,10 +734,6 @@ srs_error_t SrsDash::cycle()
srs_utime_t SrsDash::cleanup_delay()
{
if (!enabled) {
return 0;
}
// We use larger timeout to cleanup the HLS, after disposed it if required.
return _srs_config->get_dash_dispose(req->vhost) * 1.1;
}

@ -1237,10 +1237,6 @@ srs_error_t SrsHls::cycle()
{
srs_error_t err = srs_success;
if (!enabled) {
return err;
}
if (last_update_time <= 0) {
last_update_time = srs_get_system_time();
}
@ -1278,10 +1274,6 @@ srs_error_t SrsHls::cycle()
srs_utime_t SrsHls::cleanup_delay()
{
if (!enabled) {
return 0;
}
// We use larger timeout to cleanup the HLS, after disposed it if required.
return _srs_config->get_hls_dispose(req->vhost) * 1.1;
}

@ -1862,7 +1862,6 @@ srs_error_t SrsLiveSourceManager::notify(int event, srs_utime_t interval, srs_ut
// When source expired, remove it.
// @see https://github.com/ossrs/srs/issues/713
if (source->stream_is_dead()) {
source->dispose();
SrsContextId cid = source->source_id();
if (cid.empty()) cid = source->pre_source_id();
srs_trace("Live: cleanup die source, id=[%s], total=%d", cid.c_str(), (int)pool.size());
@ -1962,7 +1961,7 @@ bool SrsLiveSource::stream_is_dead()
return false;
}
// Delay cleanup source.
// Delay cleanup source for at least SRS_SOURCE_CLEANUP=3 seconds
srs_utime_t now = srs_get_system_time();
if (now < stream_die_at_ + SRS_SOURCE_CLEANUP) {
return false;

Loading…
Cancel
Save