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

for #304, support config default acodec/vcodec. 2.0.118.

This commit is contained in:
winlin 2015-02-15 18:11:24 +08:00
parent 922150b2cf
commit 78f34ad46f
10 changed files with 114 additions and 381 deletions

View file

@ -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_td_ratio" && m != "hls_acodec"
&& m != "hls_storage" && m != "hls_mount" && m != "hls_td_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);
@ -3349,6 +3349,23 @@ string SrsConfig::get_hls_acodec(string vhost)
return conf->arg0();
}
string SrsConfig::get_hls_vcodec(string vhost)
{
SrsConfDirective* hls = get_hls(vhost);
if (!hls) {
return SRS_CONF_DEFAULT_HLS_VCODEC;
}
SrsConfDirective* conf = hls->get("hls_vcodec");
if (!conf) {
return SRS_CONF_DEFAULT_HLS_VCODEC;
}
return conf->arg0();
}
SrsConfDirective* SrsConfig::get_dvr(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);