Bugfix for NACK behavior. Current code sends a number of duplicate NACK requests.

Landing of 573005 On behalf of an1kumar@gmail.com

TBR=mflodman
Review URL: https://webrtc-codereview.appspot.com/1002008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3322 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pwestin@webrtc.org 2012-12-21 17:46:24 +00:00
parent f556890844
commit 1b6da28047
2 changed files with 15 additions and 2 deletions

View File

@ -7,3 +7,4 @@ Ben Strong <bstrong@gmail.com>
Petar Jovanovic <petarj@mips.com>
Martin Storsjo <martin@martin.st>
Jie Mao <maojie0924@gmail.com>
Anil Kumar <an1kumar@gmail.com>

View File

@ -1495,6 +1495,8 @@ WebRtc_Word32 ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nackList,
}
const WebRtc_Word64 now = _clock.GetTimeInMS();
const WebRtc_Word64 timeLimit = now - waitTime;
WebRtc_UWord16 nackLength = size;
WebRtc_UWord16 startId = 0;
if (_nackLastTimeSent < timeLimit) {
// send list
@ -1504,7 +1506,17 @@ WebRtc_Word32 ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nackList,
// last seq num is the same don't send list
return 0;
} else {
// send list
//
// send NACK's only for new sequence numbers to avoid re-sending
// of NACK's for sequences we have already sent
//
for (int i = 0; i < size; i++) {
if (_nackLastSeqNumberSent == nackList[i]) {
startId = i+1;
break;
}
}
nackLength = size-startId;
}
}
_nackLastTimeSent = now;
@ -1512,7 +1524,7 @@ WebRtc_Word32 ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nackList,
switch (_nackMethod) {
case kNackRtcp:
return _rtcpSender.SendRTCP(kRtcpNack, size, nackList);
return _rtcpSender.SendRTCP(kRtcpNack, nackLength, &nackList[startId]);
case kNackOff:
return -1;
};