去掉延时30s再删除直播的ts的操作。从直播到录像直接删除直播的8个ts切片。

This commit is contained in:
renlu 2022-12-07 08:52:01 +08:00
parent 696e28765b
commit 0d40bf9272
2 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@ HlsMakerSub::HlsMakerSub(float seg_duration, uint32_t seg_number, bool seg_keep)
_seg_duration = seg_duration;
_seg_keep = seg_keep;
_is_record = false;
_poller = EventPollerPool::Instance().getPoller();
//_poller = EventPollerPool::Instance().getPoller();
}
HlsMakerSub::~HlsMakerSub() {
@ -53,10 +53,11 @@ void HlsMakerSub::startRecord(bool isRecord) {
count ++;
if (count < delete_file_paths.size()) {
auto ts_path = it.second;
_poller->doDelayTask(30 * 1000, [ts_path]() {
File::delete_file(ts_path.data());
return 0;
});
File::delete_file(ts_path.data());
//_poller->doDelayTask(30 * 1000, [ts_path]() {
// File::delete_file(ts_path.data());
// return 0;
//});
}
}
}

View File

@ -131,7 +131,7 @@ private:
bool _is_record = false;
bool _is_close_stream = false;
std::string _m3u8_file_path;
toolkit::EventPoller::Ptr _poller;
//toolkit::EventPoller::Ptr _poller;
public:
std::map<uint64_t /*index*/, std::string /*file_path*/> _segment_file_paths;