1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

refine dvr, donot append the flv header.

This commit is contained in:
winlin 2015-02-19 20:08:56 +08:00
parent a984eeecab
commit 3d225e1bc7

View file

@ -383,7 +383,7 @@ int SrsDvrPlan::flv_open(string stream, string path)
srs_error("append file stream for file %s failed. ret=%d", path.c_str(), ret); srs_error("append file stream for file %s failed. ret=%d", path.c_str(), ret);
return ret; return ret;
} }
srs_warn("dvr: always append to when exists, file=%s.", path.c_str()); srs_trace("dvr: always append to when exists, file=%s.", path.c_str());
} else { } else {
if ((ret = fs->open(tmp_flv_file)) != ERROR_SUCCESS) { if ((ret = fs->open(tmp_flv_file)) != ERROR_SUCCESS) {
srs_error("open file stream for file %s failed. ret=%d", path.c_str(), ret); srs_error("open file stream for file %s failed. ret=%d", path.c_str(), ret);
@ -396,8 +396,11 @@ int SrsDvrPlan::flv_open(string stream, string path)
return ret; return ret;
} }
if ((ret = write_flv_header()) != ERROR_SUCCESS) { // when exists, donot write flv header.
return ret; if (tmp_flv_file != path) {
if ((ret = write_flv_header()) != ERROR_SUCCESS) {
return ret;
}
} }
segment->path = path; segment->path = path;