mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support config the audio overflow ratio.
This commit is contained in:
parent
e319da3329
commit
0319e85f99
5 changed files with 43 additions and 16 deletions
|
@ -1481,7 +1481,7 @@ int SrsConfig::check_config()
|
|||
for (int j = 0; j < (int)conf->directives.size(); j++) {
|
||||
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_acodec" && m != "hls_vcodec"
|
||||
&& m != "hls_storage" && m != "hls_mount" && m != "hls_td_ratio" && m != "hls_aof_ratio" && m != "hls_acodec" && m != "hls_vcodec"
|
||||
) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
|
||||
|
@ -3202,7 +3202,24 @@ double SrsConfig::get_hls_td_ratio(string vhost)
|
|||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_TD_RATIO;
|
||||
}
|
||||
|
||||
return ::atof(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
double SrsConfig::get_hls_aof_ratio(string vhost)
|
||||
{
|
||||
SrsConfDirective* hls = get_hls(vhost);
|
||||
|
||||
if (!hls) {
|
||||
return SRS_CONF_DEFAULT_HLS_AOF_RATIO;
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = hls->get("hls_aof_ratio");
|
||||
|
||||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_AOF_RATIO;
|
||||
}
|
||||
|
||||
return ::atof(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue