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

http streaming support flv start index.

This commit is contained in:
winlin 2014-05-26 13:57:08 +08:00
parent 9360b4618a
commit b13bd70c86
11 changed files with 413 additions and 20 deletions

View file

@ -263,7 +263,7 @@ int SrsDvrPlan::flv_open(string stream, string path)
segment->reset();
std::string tmp_file = path + ".tmp";
if ((ret = fs->open(tmp_file)) != ERROR_SUCCESS) {
if ((ret = fs->open_write(tmp_file)) != ERROR_SUCCESS) {
srs_error("open file stream for file %s failed. ret=%d", path.c_str(), ret);
return ret;
}
@ -287,9 +287,7 @@ int SrsDvrPlan::flv_close()
{
int ret = ERROR_SUCCESS;
if ((ret = fs->close()) != ERROR_SUCCESS) {
return ret;
}
fs->close();
std::string tmp_file = segment->path + ".tmp";
if (rename(tmp_file.c_str(), segment->path.c_str()) < 0) {
@ -552,7 +550,7 @@ int SrsDvrHssPlan::on_meta_data(SrsOnMetaDataPacket* metadata)
<< req->stream << ".header.flv";
SrsFileStream fs;
if ((ret = fs.open(path.str().c_str())) != ERROR_SUCCESS) {
if ((ret = fs.open_write(path.str().c_str())) != ERROR_SUCCESS) {
return ret;
}