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

For #299, use fragment for dvr FLV/MP4

This commit is contained in:
winlin 2017-03-18 21:41:01 +08:00
parent da4c390d69
commit 8d679a6f9a
5 changed files with 44 additions and 60 deletions

View file

@ -90,6 +90,22 @@ int SrsFragment::unlink_file()
return ret;
}
int SrsFragment::create_dir()
{
int ret = ERROR_SUCCESS;
std::string segment_dir = srs_path_dirname(filepath);
if ((ret = srs_create_dir_recursively(segment_dir)) != ERROR_SUCCESS) {
srs_error("Create dir %s failed. ret=%d", segment_dir.c_str(), ret);
return ret;
}
srs_info("Create dir %s ok", segment_dir.c_str());
return ret;
}
string SrsFragment::tmppath()
{
return filepath + ".tmp";