HLS: 解决hls断流重新生成后异常的bug

This commit is contained in:
xiongziliang
2022-02-13 21:06:32 +08:00
parent e37982adee
commit 83c1f29253
3 changed files with 11 additions and 6 deletions

View File

@@ -37,12 +37,16 @@ HlsMakerImp::HlsMakerImp(const string &m3u8_file,
}
HlsMakerImp::~HlsMakerImp() {
clearCache(false);
clearCache(false, true);
}
void HlsMakerImp::clearCache(bool immediately) {
void HlsMakerImp::clearCache() {
clearCache(true, false);
}
void HlsMakerImp::clearCache(bool immediately, bool eof) {
//录制完了
flushLastSegment(true);
flushLastSegment(eof);
if (!isLive()) {
return;
}