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

fix #293, support http live flv/aac/mp3 stream with fast cache. 2.0.100.

This commit is contained in:
winlin 2015-01-19 13:17:46 +08:00
parent 29a8932b49
commit b7b268dfbf
9 changed files with 87 additions and 8 deletions

View file

@ -1426,7 +1426,7 @@ int SrsConfig::check_config()
} else if (n == "http_flv") {
for (int j = 0; j < (int)conf->directives.size(); j++) {
string m = conf->at(j)->name.c_str();
if (m != "enabled" && m != "mount") {
if (m != "enabled" && m != "mount" && m != "fast_cache") {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported vhost http_flv directive %s, ret=%d", m.c_str(), ret);
return ret;
@ -3469,6 +3469,30 @@ bool SrsConfig::get_vhost_http_flv_enabled(string vhost)
return false;
}
double SrsConfig::get_vhost_http_flv_fast_cache(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE;
}
conf = conf->get("http_flv");
if (!conf) {
return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE;
}
conf = conf->get("fast_cache");
if (!conf) {
return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE;
}
if (conf->arg0().empty()) {
return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE;
}
return ::atof(conf->arg0().c_str());
}
string SrsConfig::get_vhost_http_flv_mount(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);