diff --git a/srtcore/buffer_rcv.cpp b/srtcore/buffer_rcv.cpp index d790345a6..9e19884b7 100644 --- a/srtcore/buffer_rcv.cpp +++ b/srtcore/buffer_rcv.cpp @@ -148,7 +148,6 @@ CRcvBuffer::InsertInfo CRcvBuffer::insert(CUnit* unit) { SRT_ASSERT(unit != NULL); const int32_t seqno = unit->m_Packet.getSeqNo(); - //const int offset = CSeqNo::seqoff(m_iStartSeqNo, seqno); const COff offset = COff(CSeqNo(seqno) - m_iStartSeqNo); IF_RCVBUF_DEBUG(ScopedLog scoped_log); @@ -387,7 +386,7 @@ CRcvBuffer::time_point CRcvBuffer::updatePosInfo(const CUnit* unit, const COff p // position and the m_iDropOff should be calculated since that position again. void CRcvBuffer::updateGapInfo() { - COff from = m_iEndOff; //, to = m_iMaxPosOff; + COff from = m_iEndOff; SRT_ASSERT(m_entries[incPos(m_iStartPos, m_iMaxPosOff)].status == EntryState_Empty); CPos pos = incPos(m_iStartPos, from); @@ -407,7 +406,7 @@ void CRcvBuffer::updateGapInfo() // XXX This should be this way, but there are still inconsistencies // in the message code. - //SRT_ASSERT(m_entries[incPos(m_iStartPos, m_iEndOff)].status == EntryState_Empty); + //USE: SRT_ASSERT(m_entries[incPos(m_iStartPos, m_iEndOff)].status == EntryState_Empty); SRT_ASSERT(m_entries[incPos(m_iStartPos, m_iEndOff)].status != EntryState_Avail); // XXX Controversy: m_iDropOff is only used in case when SRTO_TLPKTDROP @@ -447,38 +446,6 @@ void CRcvBuffer::updateGapInfo() } } - /* OPTIMIZED, but buggy. - - int maxend = m_szSize - m_iStartPos VALUE; - int ifrom = m_iEndOff + 1; - int ito = m_iMaxPosOff VALUE; - - bool found = false; - for (int i = ifrom; i < std::min(maxend, ito); ++i) - { - if (m_entries[CPos(i)].status == EntryState_Avail) - { - m_iDropOff = i; - found = true; - break; - } - } - - if (!found && ito > maxend) - { - int upto = ito - maxend; - for (int i = 0; i < upto; ++i) - { - if (m_entries[CPos(i)].status == EntryState_Avail) - { - m_iDropOff = i; - found = true; - break; - } - } - } - */ - // Must be found somewhere, worst case at the position // of m_iMaxPosOff-1. If no finding loop caught it somehow, // it will remain at 0. The case when you have empty packets @@ -566,8 +533,6 @@ int CRcvBuffer::dropMessage(int32_t seqnolo, int32_t seqnohi, int32_t msgno, Dro << m_iStartSeqNo); // Drop by packet seqno range to also wipe those packets that do not exist in the buffer. - //const int offset_a = CSeqNo::seqoff(m_iStartSeqNo, seqnolo); - //const int offset_b = CSeqNo::seqoff(m_iStartSeqNo, seqnohi); const int offset_a = CSeqNo(seqnolo) - m_iStartSeqNo; const int offset_b = CSeqNo(seqnohi) - m_iStartSeqNo; if (offset_b < 0) @@ -624,7 +589,6 @@ int CRcvBuffer::dropMessage(int32_t seqnolo, int32_t seqnohi, int32_t msgno, Dro m_entries[i].status = EntryState_Drop; if (minDroppedOffset == -1) minDroppedOffset = offPos(m_iStartPos, i); - //minDroppedOffset = i - m_iStartPos; } if (end_off > m_iMaxPosOff) @@ -812,7 +776,6 @@ int CRcvBuffer::readMessage(char* data, size_t len, SRT_MSGCTRL* msgctrl, pair