Fix issues with incorrect wrap checks when having big buffers and high bitrate.

Introduces shared functions for timestamp and sequence number wrap checks.

BUG=1607
TESTS=trybots

Review URL: https://webrtc-codereview.appspot.com/1291005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3833 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-04-11 17:48:02 +00:00
parent 122d209e67
commit 7bc465bd21
14 changed files with 164 additions and 158 deletions

View File

@ -51,16 +51,14 @@ bool VCMDecodingState::IsOldFrame(const VCMFrameBuffer* frame) const {
assert(frame != NULL);
if (in_initial_state_)
return false;
return (LatestTimestamp(time_stamp_, frame->TimeStamp(), NULL)
== time_stamp_);
return !IsNewerTimestamp(frame->TimeStamp(), time_stamp_);
}
bool VCMDecodingState::IsOldPacket(const VCMPacket* packet) const {
assert(packet != NULL);
if (in_initial_state_)
return false;
return (LatestTimestamp(time_stamp_, packet->timestamp, NULL)
== time_stamp_);
return !IsNewerTimestamp(packet->timestamp, time_stamp_);
}
void VCMDecodingState::SetState(const VCMFrameBuffer* frame) {
@ -106,7 +104,7 @@ void VCMDecodingState::UpdateOldPacket(const VCMPacket* packet) {
if (packet->timestamp == time_stamp_) {
// Late packet belonging to the last decoded frame - make sure we update the
// last decoded sequence number.
sequence_num_ = LatestSequenceNumber(packet->seqNum, sequence_num_, NULL);
sequence_num_ = LatestSequenceNumber(packet->seqNum, sequence_num_);
}
}