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

fix #264, support disconnect publish connect when hls error. 1.0.11

This commit is contained in:
winlin 2014-12-20 11:45:59 +08:00
parent d4fb58b175
commit 1dfac0bf1d
6 changed files with 71 additions and 20 deletions

View file

@ -797,6 +797,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;
@ -1356,7 +1357,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;
@ -2910,6 +2911,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);