提交 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
// expected:" << expected << "\n";
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)
totalSourceLost = this->sourceLostPrior;
......@@ -561,8 +561,7 @@ namespace RTC
// Calculate number of packets lost in the edge in this interval.
uint32_t totalLost = report->GetTotalLost();
// Just in case (we must not trust whatever the received RR says).
// TODO: Yes?
// Do not trust whatever the received RR says.
if (totalLost < this->lostPrior)
totalLost = this->lostPrior;
......@@ -574,11 +573,8 @@ namespace RTC
// std::cout << "RtpStreamSend::UpdateScore() 3: totalLost:" << totalLost << ", lost:" << lost << "\n";
// Substract number of packets lost at the source.
//
// TODO: This may need this guard. Without it (or maybe even with it) score
// becomes > 10 sometimes:
// if (lost > sourceLost)
lost -= sourceLost;
if (lost > sourceLost)
lost = sourceLost;
// TODO: REMOVE
// std::cout << "RtpStreamSend::UpdateScore() 4: lost -= sourceLost:" << lost << "\n";
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论