diff --git a/src/Record/HlsMakerSub.cpp b/src/Record/HlsMakerSub.cpp index 361aeb33..84a033ae 100644 --- a/src/Record/HlsMakerSub.cpp +++ b/src/Record/HlsMakerSub.cpp @@ -43,24 +43,24 @@ void HlsMakerSub::startRecord(bool isRecord) { if (isRecord == _is_record) { return; } - //如果是录像,则删除之前直播的8个ts文件 - if (isRecord) { - std::map delete_file_paths = _segment_file_paths; - _segment_file_paths.clear(); - int count = 0; - //删除_segment_file_paths路径对应的直播文件,过30s再删除,免得hls直播突然断掉 - for (auto it : delete_file_paths) { - count ++; - if (count < delete_file_paths.size()) { - auto ts_path = it.second; - File::delete_file(ts_path.data()); - //_poller->doDelayTask(30 * 1000, [ts_path]() { - // File::delete_file(ts_path.data()); - // return 0; - //}); - } - } - } + ////如果是录像,则删除之前直播的8个ts文件 + //if (isRecord) { + // std::map delete_file_paths = _segment_file_paths; + // _segment_file_paths.clear(); + // int count = 0; + // //删除_segment_file_paths路径对应的直播文件,过10s再删除,免得hls直播突然断掉 + // for (auto it : delete_file_paths) { + // count ++; + // if (count < delete_file_paths.size()) { + // auto ts_path = it.second; + // File::delete_file(ts_path.data()); + // _poller->doDelayTask(10 * 1000, [ts_path]() { + // File::delete_file(ts_path.data()); + // return 0; + // }); + // } + // } + //} if(isRecord) { _seg_keep = true; diff --git a/src/Record/HlsMakerSub.h b/src/Record/HlsMakerSub.h index 622f1b5b..330447c4 100644 --- a/src/Record/HlsMakerSub.h +++ b/src/Record/HlsMakerSub.h @@ -18,7 +18,7 @@ #include "Util/File.h" #include "Util/util.h" #include "Util/logger.h" -#include "ZLToolKit/src/Poller/EventPoller.h" +//#include "ZLToolKit/src/Poller/EventPoller.h" namespace mediakit { class HlsMakerSub {