mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 00:37:39 +08:00
再优化dts获取
This commit is contained in:
parent
9d9f6e304e
commit
1067c5a2d3
@ -91,7 +91,6 @@ int64_t Stamp::getRelativeStamp() const {
|
||||
return _relativeStamp;
|
||||
}
|
||||
|
||||
|
||||
bool DtsGenerator::getDts(uint32_t pts, uint32_t &dts){
|
||||
bool ret = false;
|
||||
if (pts == _last_pts) {
|
||||
@ -100,18 +99,21 @@ bool DtsGenerator::getDts(uint32_t pts, uint32_t &dts){
|
||||
dts = _last_dts;
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} else {
|
||||
//pts变了,尝试计算dts
|
||||
ret = getDts_l(pts, dts);
|
||||
if (ret) {
|
||||
//获取到了dts,保存本次结果
|
||||
_last_dts = dts;
|
||||
}else{
|
||||
}
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
//pts排序列队长度还不知道,也就是不知道有没有B帧,
|
||||
//那么先强制dts == pts,这样可能导致有B帧的情况下,起始画面有几帧回退
|
||||
dts = pts;
|
||||
}
|
||||
|
||||
//记录上次pts
|
||||
_last_pts = pts;
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user