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

Refine get_mr_sleep in time unit

This commit is contained in:
winlin 2019-04-09 09:20:44 +08:00
parent 5df8f2f6c1
commit 839a496d50
17 changed files with 52 additions and 54 deletions

View file

@ -4654,24 +4654,26 @@ bool SrsConfig::get_mr_enabled(string vhost)
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
int SrsConfig::get_mr_sleep_ms(string vhost)
srs_utime_t SrsConfig::get_mr_sleep(string vhost)
{
static srs_utime_t DEFAULT = SRS_PERF_MR_SLEEP;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_PERF_MR_SLEEP;
return DEFAULT;
}
conf = conf->get("publish");
if (!conf) {
return SRS_PERF_MR_SLEEP;
return DEFAULT;
}
conf = conf->get("mr_latency");
if (!conf || conf->arg0().empty()) {
return SRS_PERF_MR_SLEEP;
return DEFAULT;
}
return ::atoi(conf->arg0().c_str());
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
}
int SrsConfig::get_mw_sleep_ms(string vhost)