1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

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

This commit is contained in:
winlin 2015-06-03 10:13:46 +08:00
parent 4e42b9c628
commit af9efe9213
3 changed files with 12 additions and 3 deletions

View file

@ -624,8 +624,9 @@ vhost with-hls.srs.com {
# the timeout in seconds to dispose the hls, # the timeout in seconds to dispose the hls,
# dispose is to remove all hls files, m3u8 and ts files. # dispose is to remove all hls files, m3u8 and ts files.
# when timeout or server terminate, dispose hls. # when timeout or server terminate, dispose hls.
# default: 300 # @remark 0 to disable dispose.
hls_dispose 300; # default: 0
hls_dispose 0;
# the max size to notify hls, # the max size to notify hls,
# to read max bytes from ts of specified cdn network, # to read max bytes from ts of specified cdn network,
# @remark only used when on_hls_notify is config. # @remark only used when on_hls_notify is config.

View file

@ -3566,7 +3566,7 @@ int SrsConfig::get_hls_dispose(string vhost)
{ {
SrsConfDirective* conf = get_hls(vhost); SrsConfDirective* conf = get_hls(vhost);
int DEFAULT = 300; int DEFAULT = 0;
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;

View file

@ -1155,6 +1155,14 @@ void SrsHls::dispose()
on_unpublish(); 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(); muxer->dispose();
} }