HLS切片间隔以数据时间戳为准:#463

This commit is contained in:
xiongziliang
2020-09-12 20:49:00 +08:00
parent 1b9550cfc4
commit 1e1b3794da
3 changed files with 65 additions and 60 deletions

View File

@@ -80,9 +80,10 @@ protected:
/**
* 关闭上个ts切片并且写入m3u8索引
* @param timestamp 毫秒时间戳
* @param eof
*/
void flushLastSegment(bool eof = false);
void flushLastSegment(uint32_t timestamp, bool eof = false);
private:
/**
@@ -103,11 +104,10 @@ private:
void addNewSegment(uint32_t timestamp);
private:
uint32_t _seg_number = 0;
float _seg_duration = 0;
uint32_t _seg_number = 0;
uint32_t _last_seg_timestamp = 0;
uint64_t _file_index = 0;
Ticker _ticker;
Ticker _ticker_last_data;
string _last_file_name;
std::deque<tuple<int,string> > _seg_dur_list;
};