mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-30 23:02:24 +08:00
增加长期保存hls切片的功能,segKeep=0为不长期保存,segKeep=1为长期保存。此功能部分等效于segNum=0的情况,不同的是这个保留不会在m3u8文件中体现。
This commit is contained in:
@@ -23,7 +23,8 @@ HlsMakerImp::HlsMakerImp(const string &m3u8_file,
|
||||
const string ¶ms,
|
||||
uint32_t bufSize,
|
||||
float seg_duration,
|
||||
uint32_t seg_number) : HlsMaker(seg_duration, seg_number) {
|
||||
uint32_t seg_number,
|
||||
bool seg_keep):HlsMaker(seg_duration, seg_number, seg_keep) {
|
||||
_poller = EventPollerPool::Instance().getPoller();
|
||||
_path_prefix = m3u8_file.substr(0, m3u8_file.rfind('/'));
|
||||
_path_hls = m3u8_file;
|
||||
@@ -47,7 +48,7 @@ void HlsMakerImp::clearCache() {
|
||||
void HlsMakerImp::clearCache(bool immediately, bool eof) {
|
||||
//录制完了
|
||||
flushLastSegment(eof);
|
||||
if (!isLive()) {
|
||||
if (!isLive()||isKeep()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user