mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #351, support config the m3u8/ts path for hls. 2.0.149.
This commit is contained in:
parent
85afb6ea6f
commit
692b751da8
13 changed files with 235 additions and 110 deletions
|
@ -1482,6 +1482,7 @@ int SrsConfig::check_config()
|
|||
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_aof_ratio" && m != "hls_acodec" && m != "hls_vcodec"
|
||||
&& m != "hls_m3u8_file" && m != "hls_ts_file"
|
||||
) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported vhost hls directive %s, ret=%d", m.c_str(), ret);
|
||||
|
@ -3168,7 +3169,41 @@ string SrsConfig::get_hls_path(string vhost)
|
|||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_PATH;
|
||||
}
|
||||
|
||||
return conf->arg0();
|
||||
}
|
||||
|
||||
string SrsConfig::get_hls_m3u8_file(string vhost)
|
||||
{
|
||||
SrsConfDirective* hls = get_hls(vhost);
|
||||
|
||||
if (!hls) {
|
||||
return SRS_CONF_DEFAULT_HLS_M3U8_FILE;
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = hls->get("hls_m3u8_file");
|
||||
|
||||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_M3U8_FILE;
|
||||
}
|
||||
|
||||
return conf->arg0();
|
||||
}
|
||||
|
||||
string SrsConfig::get_hls_ts_file(string vhost)
|
||||
{
|
||||
SrsConfDirective* hls = get_hls(vhost);
|
||||
|
||||
if (!hls) {
|
||||
return SRS_CONF_DEFAULT_HLS_TS_FILE;
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = hls->get("hls_ts_file");
|
||||
|
||||
if (!conf) {
|
||||
return SRS_CONF_DEFAULT_HLS_TS_FILE;
|
||||
}
|
||||
|
||||
return conf->arg0();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue