mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
优化rtsp性能
This commit is contained in:
parent
e4126809a6
commit
1539e4ed60
@ -398,8 +398,7 @@ void RtspPusher::sendRtpPacket(const RtspMediaSource::RingDataType &pkt) {
|
||||
if (++i == size) {
|
||||
setSendFlushFlag(true);
|
||||
}
|
||||
BufferRtp::Ptr buffer(new BufferRtp(rtp));
|
||||
send(std::move(buffer));
|
||||
send(rtp);
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -416,8 +415,7 @@ void RtspPusher::sendRtpPacket(const RtspMediaSource::RingDataType &pkt) {
|
||||
return;
|
||||
}
|
||||
|
||||
BufferRtp::Ptr buffer(new BufferRtp(rtp, 4));
|
||||
pSock->send(std::move(buffer), nullptr, 0, ++i == size);
|
||||
pSock->send(std::make_shared<BufferRtp>(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -1178,9 +1178,8 @@ void RtspSession::sendRtpPacket(const RtspMediaSource::RingDataType &pkt) {
|
||||
shutdown(SockException(Err_shutdown, "udp sock not opened yet"));
|
||||
return;
|
||||
}
|
||||
BufferRtp::Ptr buffer(new BufferRtp(rtp, 4));
|
||||
_bytes_usage += buffer->size();
|
||||
pSock->send(std::move(buffer), nullptr, 0, ++i == size);
|
||||
_bytes_usage += rtp->size() - RtpPacket::kRtpTcpHeaderSize;
|
||||
pSock->send(std::make_shared<BufferRtp>(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user