mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #304, use stringstream to generate m3u8, add hls_td_ratio. 2.0.116.
This commit is contained in:
parent
103ce78b35
commit
25af6c6847
7 changed files with 60 additions and 52 deletions
|
@ -1480,7 +1480,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_path" && m != "hls_fragment" && m != "hls_window" && m != "hls_on_error"
|
||||
&& m != "hls_storage" && m != "hls_mount"
|
||||
&& m != "hls_storage" && m != "hls_mount" && m != "hls_td_ratio"
|
||||
) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
|
||||
|
@ -3247,6 +3247,23 @@ double SrsConfig::get_hls_fragment(string vhost)
|
|||
return ::atof(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
double SrsConfig::get_hls_td_ratio(string vhost)
|
||||
{
|
||||
SrsConfDirective* hls = get_hls(vhost);
|
||||
|
||||
if (!hls) {
|
||||
return SRS_CONF_DEFAULT_HLS_TD_RATIO;
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = hls->get("hls_td_ratio");
|
||||
|
||||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_TD_RATIO;
|
||||
}
|
||||
|
||||
return ::atof(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
double SrsConfig::get_hls_window(string vhost)
|
||||
{
|
||||
SrsConfDirective* hls = get_hls(vhost);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue