修复hls首个切片延迟生成的问题

This commit is contained in:
Weiwei.Zhou 2019-10-11 16:16:14 +08:00
parent a604d8c620
commit 7d76a3eb9b

View File

@ -103,7 +103,7 @@ void HlsMaker::delOldFile() {
void HlsMaker::addNewFile(uint32_t) { void HlsMaker::addNewFile(uint32_t) {
_stampInc = _ticker.elapsedTime(); _stampInc = _ticker.elapsedTime();
if (_stampInc >= _seg_duration * 1000) { if (_file_index == 0 || _stampInc >= _seg_duration * 1000) {
_ticker.resetTime(); _ticker.resetTime();
auto file_name = onOpenFile(_file_index); auto file_name = onOpenFile(_file_index);
if (_file_index++ > 0) { if (_file_index++ > 0) {