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

refine code for hooks and http core.

This commit is contained in:
winlin 2015-12-29 18:33:02 +08:00
parent 79fdc4e766
commit f516636448
12 changed files with 144 additions and 43 deletions

View file

@ -4522,19 +4522,21 @@ bool SrsConfig::get_mix_correct(string vhost)
double SrsConfig::get_queue_length(string vhost)
{
static double DEFAULT = SRS_PERF_PLAY_QUEUE;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_PERF_PLAY_QUEUE;
return DEFAULT;
}
conf = conf->get("play");
if (!conf || conf->arg0().empty()) {
return SRS_PERF_GOP_CACHE;
return DEFAULT;
}
conf = conf->get("queue_length");
if (!conf || conf->arg0().empty()) {
return SRS_PERF_PLAY_QUEUE;
return DEFAULT;
}
return ::atoi(conf->arg0().c_str());