提交 8042b615 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Cosmetic

上级 b9a26d80
......@@ -45,7 +45,7 @@ namespace RTC
private:
void AddPacketsToNackList(uint32_t seq32Start, uint32_t seq32End);
void RemoveFromNackListOlderThan(uint32_t seq32);
void RemoveFromNackListOlderThan(RTC::RtpPacket* packet);
std::vector<uint16_t> GetNackBatch(NackFilter filter);
void MayRunTimer() const;
......
......@@ -49,7 +49,7 @@ namespace RTC
// If a key frame remove all the items in the nack list older than this seq.
if (packet->IsKeyFrame())
RemoveFromNackListOlderThan(seq32);
RemoveFromNackListOlderThan(packet);
// Obviously never nacked, so ignore.
if (seq32 == this->lastSeq32)
......@@ -145,20 +145,29 @@ namespace RTC
}
}
void NackGenerator::RemoveFromNackListOlderThan(uint32_t seq32)
// Delete all the entries in the NACK list whose key (seq32) is older than
// the given one.
void NackGenerator::RemoveFromNackListOlderThan(RTC::RtpPacket* packet)
{
MS_TRACE();
// Delete all the entries in the NACK list whose key (seq32) is older than
// the given one.
MS_ERROR("---- PRE, nackList.size:%zu", this->nackList.size());
uint32_t seq32 = packet->GetExtendedSequenceNumber();
uint32_t numItemsBefore = this->nackList.size();
auto it = this->nackList.lower_bound(seq32);
this->nackList.erase(this->nackList.begin(), it);
MS_ERROR("---- POST, nackList.size:%zu", this->nackList.size());
uint32_t numItemsRemoved = numItemsBefore - this->nackList.size();
if (numItemsRemoved > 0)
{
MS_DEBUG_TAG(
rtx,
"removed %" PRIu32 " old NACK items older than received key frame [seq:%" PRIu16 "]",
numItemsRemoved,
packet->GetSequenceNumber());
}
}
std::vector<uint16_t> NackGenerator::GetNackBatch(NackFilter filter)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论