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

support config the hls_nb_notify.

This commit is contained in:
winlin 2015-04-10 14:44:18 +08:00
parent 0a7cea063c
commit 5d37e47783
6 changed files with 39 additions and 6 deletions

View file

@ -1487,7 +1487,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_cleanup"
&& m != "hls_m3u8_file" && m != "hls_ts_file" && m != "hls_ts_floor" && m != "hls_cleanup" && m != "hls_nb_notify"
) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
@ -2440,6 +2440,22 @@ SrsConfDirective* SrsConfig::get_vhost_on_hls_notify(string vhost)
return conf->get("on_hls_notify");
}
int SrsConfig::get_vhost_hls_nb_notify(string vhost)
{
SrsConfDirective* conf = get_vhost_http_hooks(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_HLS_NB_NOTIFY;
}
conf = conf->get("hls_nb_notify");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_HLS_NB_NOTIFY;
}
return ::atoi(conf->arg0().c_str());
}
bool SrsConfig::get_bw_check_enabled(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);