mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
HLS: 加速track就绪速度 (#1286)
* 加速track的准备速度 * 重命名为isAllTrackReady * 无须缓冲帧时,暂不用转换为可缓存帧 Co-authored-by: 夏楚 <771730766@qq.com>
This commit is contained in:
parent
f27893ffa5
commit
0b2e55429d
@ -108,6 +108,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
vector<Track::Ptr> getTracks(bool trackReady = true) const override;
|
vector<Track::Ptr> getTracks(bool trackReady = true) const override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回是否所有track已经准备完成
|
||||||
|
*/
|
||||||
|
bool isAllTrackReady() const {
|
||||||
|
return _all_track_ready;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加aac静音轨道
|
* 添加aac静音轨道
|
||||||
*/
|
*/
|
||||||
|
@ -316,6 +316,12 @@ void HlsDemuxer::start(const EventPoller::Ptr &poller, TrackListener *listener)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HlsDemuxer::inputFrame(const Frame::Ptr &frame) {
|
bool HlsDemuxer::inputFrame(const Frame::Ptr &frame) {
|
||||||
|
//为了避免track准备时间过长, 因此在没准备好之前, 直接消费掉所有的帧
|
||||||
|
if (!_delegate.isAllTrackReady()) {
|
||||||
|
_delegate.inputFrame(frame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//计算相对时间戳
|
//计算相对时间戳
|
||||||
int64_t dts, pts;
|
int64_t dts, pts;
|
||||||
_stamp[frame->getTrackType()].revise(frame->dts(), frame->pts(), dts, pts);
|
_stamp[frame->getTrackType()].revise(frame->dts(), frame->pts(), dts, pts);
|
||||||
|
Loading…
Reference in New Issue
Block a user