Unverified 提交 6c984ae6 authored 作者: Gustavo Garcia's avatar Gustavo Garcia 提交者: GitHub

Fix check division by zero in transport congestion control (#1049)

上级 bb0e27d8
...@@ -222,7 +222,11 @@ namespace RTC ...@@ -222,7 +222,11 @@ namespace RTC
if (!result.received) if (!result.received)
lost_packets += 1; lost_packets += 1;
} }
if (expected_packets > 0)
{
this->UpdatePacketLoss(static_cast<double>(lost_packets) / expected_packets); this->UpdatePacketLoss(static_cast<double>(lost_packets) / expected_packets);
}
if (this->rtpTransportControllerSend == nullptr) if (this->rtpTransportControllerSend == nullptr)
{ {
......
...@@ -240,7 +240,10 @@ namespace RTC ...@@ -240,7 +240,10 @@ namespace RTC
lost_packets += 1; lost_packets += 1;
} }
if (expected_packets > 0)
{
this->UpdatePacketLoss(static_cast<double>(lost_packets) / expected_packets); this->UpdatePacketLoss(static_cast<double>(lost_packets) / expected_packets);
}
// Create a new feedback packet. // Create a new feedback packet.
this->transportCcFeedbackPacket.reset(new RTC::RTCP::FeedbackRtpTransportPacket( this->transportCcFeedbackPacket.reset(new RTC::RTCP::FeedbackRtpTransportPacket(
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论