- fixed problem with loss packet counter (it was higher than real value)
This commit is contained in:
@@ -108,7 +108,7 @@ bool RtpBuffer::add(std::shared_ptr<jrtplib::RTPPacket> packet, int timelength,
|
||||
Lock l(mGuard);
|
||||
|
||||
// Update statistics
|
||||
mStat.mSsrc = packet->GetSSRC();
|
||||
mStat.mSsrc = static_cast<uint16_t>(packet->GetSSRC());
|
||||
|
||||
// Update jitter
|
||||
ICELogMedia(<< "Adding new packet into jitter buffer");
|
||||
@@ -149,12 +149,14 @@ bool RtpBuffer::add(std::shared_ptr<jrtplib::RTPPacket> packet, int timelength,
|
||||
// Limit by max timelength
|
||||
available = findTimelength();
|
||||
|
||||
while (available > mHigh && mPacketList.size())
|
||||
if (available > mHigh)
|
||||
ICELogMedia(<< "Available " << available << "ms with limit " << mHigh << "ms");
|
||||
/*while (available > mHigh && mPacketList.size())
|
||||
{
|
||||
//ICELogMedia( << "Dropping RTP packet from jitter");
|
||||
ICELogDebug( << "Dropping RTP packet from jitter buffer");
|
||||
available -= mPacketList.front().timelength();
|
||||
mPacketList.erase(mPacketList.begin());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,6 +178,18 @@ RtpBuffer::FetchResult RtpBuffer::fetch(ResultList& rl)
|
||||
// See if there is enough information in buffer
|
||||
int total = findTimelength();
|
||||
|
||||
while (total > mHigh && mPacketList.size())
|
||||
{
|
||||
ICELogMedia( << "Dropping RTP packets from jitter buffer");
|
||||
total -= mPacketList.front().timelength();
|
||||
|
||||
// Save it as last packet however - to not confuse loss packet counter
|
||||
mFetchedPacket = mPacketList.front();
|
||||
|
||||
// Erase from packet list
|
||||
mPacketList.erase(mPacketList.begin());
|
||||
}
|
||||
|
||||
if (total < mLow)
|
||||
result = FetchResult::NoPacket;
|
||||
else
|
||||
|
||||
@@ -313,7 +313,9 @@ void AudioStream::dataArrived(PDatagramSocket s, const void* buffer, int length,
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ICELogDebug(<< "Packet no: " << RtpHelper::findPacketNo(mReceiveBuffer, receiveLength));
|
||||
|
||||
switch (source.family())
|
||||
{
|
||||
case AF_INET:
|
||||
@@ -362,7 +364,7 @@ void AudioStream::dataArrived(PDatagramSocket s, const void* buffer, int length,
|
||||
|
||||
// Process incoming data packet
|
||||
rtpStream->process(packet);
|
||||
|
||||
|
||||
double rtt = mRtpSession.GetCurrentSourceInfo()->INF_GetRoundtripTime().GetDouble();
|
||||
if (rtt > 0)
|
||||
mStat.mRttDelay.process(rtt);
|
||||
|
||||
Reference in New Issue
Block a user