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

merge from 1.0release for bug #264. 2.0.74

This commit is contained in:
winlin 2014-12-20 11:58:39 +08:00
commit eef8034632
6 changed files with 72 additions and 22 deletions

View file

@ -798,6 +798,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
srs_trace("vhost %s reload forward success.", vhost.c_str());
}
// hls, only one per vhost
// @remark, the hls_on_error directly support reload.
if (!srs_directive_equals(new_vhost->get("hls"), old_vhost->get("hls"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
@ -1412,7 +1413,7 @@ int SrsConfig::check_config()
} else if (n == "hls") {
for (int j = 0; j < (int)conf->directives.size(); j++) {
string m = conf->at(j)->name.c_str();
if (m != "enabled" && m != "hls_path" && m != "hls_fragment" && m != "hls_window") {
if (m != "enabled" && m != "hls_path" && m != "hls_fragment" && m != "hls_window" && m != "hls_on_error") {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
return ret;
@ -3064,6 +3065,23 @@ double SrsConfig::get_hls_window(string vhost)
return ::atof(conf->arg0().c_str());
}
string SrsConfig::get_hls_on_error(string vhost)
{
SrsConfDirective* hls = get_hls(vhost);
if (!hls) {
return SRS_CONF_DEFAULT_HLS_ON_ERROR;
}
SrsConfDirective* conf = hls->get("hls_on_error");
if (!conf) {
return SRS_CONF_DEFAULT_HLS_ON_ERROR;
}
return conf->arg0();
}
SrsConfDirective* SrsConfig::get_dvr(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);