From fe526ff10fea5cc9f456f9a9313499f19bd7c8d0 Mon Sep 17 00:00:00 2001 From: "henrike@webrtc.org" Date: Wed, 25 Jun 2014 20:59:51 +0000 Subject: [PATCH] fix after r6472 in rtp_sender, comparison between signed and unsigned integer expressions. BUG=N/A R=pwestin@webrtc.org, wu@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15909004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6539 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/rtp_rtcp/source/rtp_sender.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index 7cfcd7222..74947693b 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -705,7 +705,7 @@ void RTPSender::OnReceivedNACK( bool RTPSender::ProcessNACKBitRate(const uint32_t now) { uint32_t num = 0; int byte_count = 0; - const int kAvgIntervalMs = 1000; + const uint32_t kAvgIntervalMs = 1000; uint32_t target_bitrate = GetTargetBitrate(); CriticalSectionScoped cs(send_critsect_); @@ -721,13 +721,12 @@ bool RTPSender::ProcessNACKBitRate(const uint32_t now) { byte_count += nack_byte_count_[num]; } } - int time_interval = kAvgIntervalMs; + uint32_t time_interval = kAvgIntervalMs; if (num == NACK_BYTECOUNT_SIZE) { // More than NACK_BYTECOUNT_SIZE nack messages has been received // during the last msg_interval. - time_interval = now - nack_byte_count_times_[num - 1]; - if (time_interval < 0) { - time_interval = kAvgIntervalMs; + if (nack_byte_count_times_[num - 1] <= now) { + time_interval = now - nack_byte_count_times_[num - 1]; } } return (byte_count * 8) <