mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Merge branch '2.0release' into develop
This commit is contained in:
commit
5dd81d182c
3 changed files with 12 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue