mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 10:58:11 +08:00
使用临时变量和std::move减少智能指针的拷贝构造
This commit is contained in:
@@ -47,7 +47,7 @@ public:
|
||||
/**
|
||||
* 输入rtp并解析
|
||||
*/
|
||||
void onWrite(const RtpPacket::Ptr &rtp, bool key_pos) override {
|
||||
void onWrite(RtpPacket::Ptr rtp, bool key_pos) override {
|
||||
if (_all_track_ready && !_muxer->isEnabled()) {
|
||||
//获取到所有Track后,并且未开启转协议,那么不需要解复用rtp
|
||||
//在关闭rtp解复用后,无法知道是否为关键帧,这样会导致无法秒开,或者开播花屏
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
//需要解复用rtp
|
||||
key_pos = _demuxer->inputRtp(rtp);
|
||||
}
|
||||
RtspMediaSource::onWrite(rtp, key_pos);
|
||||
RtspMediaSource::onWrite(std::move(rtp), key_pos);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user