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:
parent
deb54b8866
commit
dc8a63fb3c
1 changed files with 4 additions and 1 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue