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

fix #366, config hls to disable cleanup of ts. 2.0.154.

This commit is contained in:
winlin 2015-04-02 11:52:03 +08:00
parent 717d088376
commit 8401d9ac06
7 changed files with 56 additions and 20 deletions

View file

@ -1482,7 +1482,7 @@ int SrsConfig::check_config()
string m = conf->at(j)->name.c_str();
if (m != "enabled" && m != "hls_entry_prefix" && m != "hls_path" && m != "hls_fragment" && m != "hls_window" && m != "hls_on_error"
&& m != "hls_storage" && m != "hls_mount" && m != "hls_td_ratio" && m != "hls_aof_ratio" && m != "hls_acodec" && m != "hls_vcodec"
&& m != "hls_m3u8_file" && m != "hls_ts_file" && m != "hls_ts_floor"
&& m != "hls_m3u8_file" && m != "hls_ts_file" && m != "hls_ts_floor" && m != "hls_cleanup"
) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
@ -3388,6 +3388,23 @@ string SrsConfig::get_hls_vcodec(string vhost)
return conf->arg0();
}
bool SrsConfig::get_hls_cleanup(string vhost)
{
SrsConfDirective* hls = get_hls(vhost);
if (!hls) {
return SRS_CONF_DEFAULT_HLS_CLEANUP;
}
SrsConfDirective* conf = hls->get("hls_cleanup");
if (!conf && conf->arg0() != "off") {
return SRS_CONF_DEFAULT_HLS_CLEANUP;
}
return false;
}
SrsConfDirective *SrsConfig::get_hds(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);