diff --git a/src/Rtsp/RtspPusher.cpp b/src/Rtsp/RtspPusher.cpp index 4dde91a3..abde7063 100644 --- a/src/Rtsp/RtspPusher.cpp +++ b/src/Rtsp/RtspPusher.cpp @@ -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(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size); }); break; } diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index 781732d1..23be644e 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -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(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size); }); } break;