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

RTC: Refine config code

This commit is contained in:
winlin 2020-07-14 14:01:38 +08:00
parent deb54b8866
commit dc8a63fb3c

View file

@ -5078,7 +5078,6 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
static bool DEFAULT = true; static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -5099,18 +5098,22 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
bool SrsConfig::get_rtc_twcc_enabled(string vhost) bool SrsConfig::get_rtc_twcc_enabled(string vhost)
{ {
static bool DEFAULT = true; static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
conf = conf->get("twcc"); conf = conf->get("twcc");
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
conf = conf->get("enabled"); conf = conf->get("enabled");
if (!conf || conf->arg0().empty()) { if (!conf || conf->arg0().empty()) {
return DEFAULT; return DEFAULT;
} }
return SRS_CONF_PERFER_TRUE(conf->arg0()); return SRS_CONF_PERFER_TRUE(conf->arg0());
} }