mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
parent
3a8e954255
commit
100822f079
@ -73,6 +73,11 @@ void HlsMaker::makeIndexFile(bool eof) {
|
|||||||
|
|
||||||
void HlsMaker::inputData(void *data, size_t len, uint32_t timestamp, bool is_idr_fast_packet) {
|
void HlsMaker::inputData(void *data, size_t len, uint32_t timestamp, bool is_idr_fast_packet) {
|
||||||
if (data && len) {
|
if (data && len) {
|
||||||
|
if (timestamp < _last_timestamp) {
|
||||||
|
//时间戳回退了,切片时长重新计时
|
||||||
|
WarnL << "stamp reduce: " << _last_timestamp << " -> " << timestamp;
|
||||||
|
_last_seg_timestamp = _last_timestamp = timestamp;
|
||||||
|
}
|
||||||
if (is_idr_fast_packet) {
|
if (is_idr_fast_packet) {
|
||||||
//尝试切片ts
|
//尝试切片ts
|
||||||
addNewSegment(timestamp);
|
addNewSegment(timestamp);
|
||||||
@ -130,7 +135,6 @@ void HlsMaker::flushLastSegment(bool eof){
|
|||||||
seg_dur = 100;
|
seg_dur = 100;
|
||||||
}
|
}
|
||||||
_seg_dur_list.push_back(std::make_tuple(seg_dur, std::move(_last_file_name)));
|
_seg_dur_list.push_back(std::make_tuple(seg_dur, std::move(_last_file_name)));
|
||||||
_last_file_name.clear();
|
|
||||||
delOldSegment();
|
delOldSegment();
|
||||||
//先flush ts切片,否则可能存在ts文件未写入完毕就被访问的情况
|
//先flush ts切片,否则可能存在ts文件未写入完毕就被访问的情况
|
||||||
onFlushLastSegment(seg_dur);
|
onFlushLastSegment(seg_dur);
|
||||||
|
Loading…
Reference in New Issue
Block a user