mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-05-06 23:33:47 +08:00
修复webrtc播放时生成config rtp线程安全的bug
rtsp直接代理时会从config frame生成rtp,在获取VideoTrack配置帧列表时存在线程安全风险; 同时简化getConfigFrames函数代码,去除缓存逻辑。
This commit is contained in:
@@ -182,14 +182,18 @@ void H265Track::setExtraData(const uint8_t *data, size_t bytes) {
|
||||
}
|
||||
|
||||
bool H265Track::update() {
|
||||
_config_frames = std::vector<Frame::Ptr>{
|
||||
createConfigFrame<H265Frame>(_vps, 0, getIndex()),
|
||||
createConfigFrame<H265Frame>(_sps, 0, getIndex()),
|
||||
createConfigFrame<H265Frame>(_pps, 0, getIndex())
|
||||
};
|
||||
return getHEVCInfo(_vps, _sps, _width, _height, _fps);
|
||||
}
|
||||
|
||||
std::vector<Frame::Ptr> H265Track::getConfigFrames() const {
|
||||
if (!ready()) {
|
||||
return {};
|
||||
}
|
||||
return { createConfigFrame<H265Frame>(_vps, 0, getIndex()),
|
||||
createConfigFrame<H265Frame>(_sps, 0, getIndex()),
|
||||
createConfigFrame<H265Frame>(_pps, 0, getIndex()) };
|
||||
}
|
||||
|
||||
Track::Ptr H265Track::clone() const {
|
||||
return std::make_shared<H265Track>(*this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user