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

fix bug of hls and rename demo player stream to live/demo. change to 0.9.36

This commit is contained in:
winlin 2014-03-26 18:13:33 +08:00
parent ea3561de08
commit 4c8d6d2eb1
8 changed files with 25 additions and 13 deletions

View file

@ -693,15 +693,17 @@ int SrsHlsMuxer::segment_close(string log_desc)
// close the muxer of finished segment.
srs_freep(current->muxer);
std::string full_path = current->full_path;
current = NULL;
// rename from tmp to real path
std::string tmp_file = current->full_path + ".tmp";
if (rename(tmp_file.c_str(), current->full_path.c_str()) < 0) {
std::string tmp_file = full_path + ".tmp";
if (rename(tmp_file.c_str(), full_path.c_str()) < 0) {
ret = ERROR_HLS_WRITE_FAILED;
srs_error("rename ts file failed, %s => %s. ret=%d",
tmp_file.c_str(), current->full_path.c_str(), ret);
tmp_file.c_str(), full_path.c_str(), ret);
return ret;
}
current = NULL;
} else {
// reuse current segment index.
file_index--;