- fix packet loss reporting
This commit is contained in:
@@ -238,11 +238,11 @@ RtpBuffer::FetchResult RtpBuffer::fetch()
|
|||||||
|
|
||||||
// Gap between new packet and previous on
|
// Gap between new packet and previous on
|
||||||
int gap = (int64_t)seqno - (int64_t)*mLastSeqno - 1;
|
int gap = (int64_t)seqno - (int64_t)*mLastSeqno - 1;
|
||||||
gap = std::min(gap, 127);
|
// gap = std::min(gap, 127);
|
||||||
if (gap > 0)
|
if (gap > 0)
|
||||||
{
|
{
|
||||||
// std::cout << "Increase the packet loss for SSRC " << std::hex << mSsrc << std::endl;
|
// std::cout << "Increase the packet loss for SSRC " << std::hex << mSsrc << std::endl;
|
||||||
mStat.mPacketLoss++;
|
mStat.mPacketLoss += gap;
|
||||||
auto currentTimestamp = std::chrono::microseconds(uint64_t(packet.rtp()->GetReceiveTime().GetDouble() * 1000000));
|
auto currentTimestamp = std::chrono::microseconds(uint64_t(packet.rtp()->GetReceiveTime().GetDouble() * 1000000));
|
||||||
|
|
||||||
if (mStat.mPacketLossTimeline.empty() || (mStat.mPacketLossTimeline.back().mEndSeqno != seqno))
|
if (mStat.mPacketLossTimeline.empty() || (mStat.mPacketLossTimeline.back().mEndSeqno != seqno))
|
||||||
@@ -251,8 +251,7 @@ RtpBuffer::FetchResult RtpBuffer::fetch()
|
|||||||
.mGap = gap,
|
.mGap = gap,
|
||||||
.mTimestamp = currentTimestamp});
|
.mTimestamp = currentTimestamp});
|
||||||
|
|
||||||
mLastSeqno = *mLastSeqno + 1; // As we deal with the audio gap - return the silence and increase last seqno
|
mLastSeqno = seqno;
|
||||||
|
|
||||||
result = {FetchResult::Status::Gap};
|
result = {FetchResult::Status::Gap};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user