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

fix #177, dvr segment add config dvr_wait_keyframe. 0.9.213.

This commit is contained in:
winlin 2014-09-25 10:59:29 +08:00
parent 87aac3ddd4
commit 83f266b9e2
8 changed files with 110 additions and 20 deletions

View file

@ -1301,7 +1301,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 != "dvr_path" && m != "dvr_plan"
&& m != "dvr_duration" && m != "time_jitter"
&& m != "dvr_duration" && m != "dvr_wait_keyframe" && m != "time_jitter"
) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported vhost dvr directive %s, ret=%d", m.c_str(), ret);
@ -2968,6 +2968,23 @@ int SrsConfig::get_dvr_duration(string vhost)
return ::atoi(conf->arg0().c_str());
}
bool SrsConfig::get_dvr_wait_keyframe(string vhost)
{
SrsConfDirective* dvr = get_dvr(vhost);
if (!dvr) {
return true;
}
SrsConfDirective* conf = dvr->get("dvr_wait_keyframe");
if (!conf || conf->arg0() != "off") {
return true;
}
return false;
}
int SrsConfig::get_dvr_time_jitter(string vhost)
{
SrsConfDirective* dvr = get_dvr(vhost);