winlin

disable the hls_dispose by default to 0, for p2p system should never cleanup for timeshift hls.

... ... @@ -624,8 +624,9 @@ vhost with-hls.srs.com {
# the timeout in seconds to dispose the hls,
# dispose is to remove all hls files, m3u8 and ts files.
# when timeout or server terminate, dispose hls.
# default: 300
hls_dispose 300;
# @remark 0 to disable dispose.
# default: 0
hls_dispose 0;
# the max size to notify hls,
# to read max bytes from ts of specified cdn network,
# @remark only used when on_hls_notify is config.
... ...
... ... @@ -3566,7 +3566,7 @@ int SrsConfig::get_hls_dispose(string vhost)
{
SrsConfDirective* conf = get_hls(vhost);
int DEFAULT = 300;
int DEFAULT = 0;
if (!conf) {
return DEFAULT;
... ...
... ... @@ -1155,6 +1155,14 @@ void SrsHls::dispose()
on_unpublish();
}
// only dispose hls when positive.
if (_req) {
int hls_dispose = _srs_config->get_hls_dispose(_req->vhost);
if (hls_dispose <= 0) {
return;
}
}
muxer->dispose();
}
... ...