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

For #1638, #307, config to discard aac for rtc

This commit is contained in:
winlin 2020-03-22 08:28:51 +08:00
parent e1fe2d1c1d
commit 2da4e0a43e
5 changed files with 37 additions and 2 deletions

View file

@ -3822,8 +3822,8 @@ srs_error_t SrsConfig::check_normal_config()
} else if (n == "rtc") {
for (int j = 0; j < (int)conf->directives.size(); j++) {
string m = conf->at(j)->name;
if (m != "enabled" && m != "bframe") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.bandcheck.%s of %s", m.c_str(), vhost->arg0().c_str());
if (m != "enabled" && m != "bframe" && m != "aac") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.rtc.%s of %s", m.c_str(), vhost->arg0().c_str());
}
}
}
@ -4381,6 +4381,24 @@ bool SrsConfig::get_rtc_bframe_discard(string vhost)
return conf->arg0() == "discard";
}
bool SrsConfig::get_rtc_aac_discard(string vhost)
{
static bool DEFAULT = false;
SrsConfDirective* conf = get_rtc(vhost);
if (!conf) {
return DEFAULT;
}
conf = conf->get("aac");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0() == "discard";
}
SrsConfDirective* SrsConfig::get_vhost(string vhost, bool try_default_vhost)
{
srs_assert(root);