提交 df266f1b authored 作者: José Luis Millán's avatar José Luis Millán

#274. Consumer score fixes. Avoid scores greater than 10

上级 c3df39ca
...@@ -544,9 +544,9 @@ namespace RTC ...@@ -544,9 +544,9 @@ namespace RTC
// expected:" << expected << "\n"; // expected:" << expected << "\n";
auto totalSent = this->transmissionCounter.GetPacketCount(); auto totalSent = this->transmissionCounter.GetPacketCount();
auto totalSourceLost = totalExpected - totalSent; auto totalSourceLost = totalExpected > totalSent ? totalExpected - totalSent : 0;
// TODO: This should not happen (but it happens, see #274), so add a guard. // Current lost may be less now than before.
if (totalSourceLost < this->sourceLostPrior) if (totalSourceLost < this->sourceLostPrior)
totalSourceLost = this->sourceLostPrior; totalSourceLost = this->sourceLostPrior;
...@@ -561,8 +561,7 @@ namespace RTC ...@@ -561,8 +561,7 @@ namespace RTC
// Calculate number of packets lost in the edge in this interval. // Calculate number of packets lost in the edge in this interval.
uint32_t totalLost = report->GetTotalLost(); uint32_t totalLost = report->GetTotalLost();
// Just in case (we must not trust whatever the received RR says). // Do not trust whatever the received RR says.
// TODO: Yes?
if (totalLost < this->lostPrior) if (totalLost < this->lostPrior)
totalLost = this->lostPrior; totalLost = this->lostPrior;
...@@ -574,11 +573,8 @@ namespace RTC ...@@ -574,11 +573,8 @@ namespace RTC
// std::cout << "RtpStreamSend::UpdateScore() 3: totalLost:" << totalLost << ", lost:" << lost << "\n"; // std::cout << "RtpStreamSend::UpdateScore() 3: totalLost:" << totalLost << ", lost:" << lost << "\n";
// Substract number of packets lost at the source. // Substract number of packets lost at the source.
// if (lost > sourceLost)
// TODO: This may need this guard. Without it (or maybe even with it) score lost = sourceLost;
// becomes > 10 sometimes:
// if (lost > sourceLost)
lost -= sourceLost;
// TODO: REMOVE // TODO: REMOVE
// std::cout << "RtpStreamSend::UpdateScore() 4: lost -= sourceLost:" << lost << "\n"; // std::cout << "RtpStreamSend::UpdateScore() 4: lost -= sourceLost:" << lost << "\n";
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论