mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +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) {
|
if (++i == size) {
|
||||||
setSendFlushFlag(true);
|
setSendFlushFlag(true);
|
||||||
}
|
}
|
||||||
BufferRtp::Ptr buffer(new BufferRtp(rtp));
|
send(rtp);
|
||||||
send(std::move(buffer));
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -416,8 +415,7 @@ void RtspPusher::sendRtpPacket(const RtspMediaSource::RingDataType &pkt) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferRtp::Ptr buffer(new BufferRtp(rtp, 4));
|
pSock->send(std::make_shared<BufferRtp>(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size);
|
||||||
pSock->send(std::move(buffer), nullptr, 0, ++i == size);
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1178,9 +1178,8 @@ void RtspSession::sendRtpPacket(const RtspMediaSource::RingDataType &pkt) {
|
|||||||
shutdown(SockException(Err_shutdown, "udp sock not opened yet"));
|
shutdown(SockException(Err_shutdown, "udp sock not opened yet"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BufferRtp::Ptr buffer(new BufferRtp(rtp, 4));
|
_bytes_usage += rtp->size() - RtpPacket::kRtpTcpHeaderSize;
|
||||||
_bytes_usage += buffer->size();
|
pSock->send(std::make_shared<BufferRtp>(rtp, RtpPacket::kRtpTcpHeaderSize), nullptr, 0, ++i == size);
|
||||||
pSock->send(std::move(buffer), nullptr, 0, ++i == size);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user