提交 7ede0400 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Reduce retransmission storage size (limit RTP packet size to 1500 bytes). Fixes #109

上级 217aa48e
......@@ -8,6 +8,9 @@
namespace RTC
{
// Max MTU size.
constexpr size_t MtuSize{ 1500 };
class RtpPacket
{
public:
......
......@@ -14,7 +14,7 @@ namespace RTC
private:
struct StorageItem
{
uint8_t store[65536];
uint8_t store[RTC::MtuSize];
};
private:
......
......@@ -444,7 +444,7 @@ namespace RTC
// Create a RtpStreamSend for sending a single media stream.
if (useNack)
this->rtpStream = new RTC::RtpStreamSend(params, 1000);
this->rtpStream = new RTC::RtpStreamSend(params, 750);
else
this->rtpStream = new RTC::RtpStreamSend(params, 0);
}
......
......@@ -330,6 +330,18 @@ namespace RTC
{
MS_TRACE();
if (packet->GetSize() > RTC::MtuSize)
{
MS_WARN_TAG(
rtp,
"packet too big [ssrc:%" PRIu32 ", seq:%" PRIu16 ", size:%zu]",
packet->GetSsrc(),
packet->GetSequenceNumber(),
packet->GetSize());
return;
}
// Sum the packet seq number and the number of 16 bits cycles.
uint32_t packetSeq32 = uint32_t{ packet->GetSequenceNumber() } + this->cycles;
BufferItem bufferItem;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论