Remove a dangerous short cast that was causing incorrect wrapping of the packet index and a few other unnecessary casts

This commit is contained in:
Cameron Gutman 2017-06-11 12:55:44 -07:00
parent 99cfae7acc
commit 88f95c7871

View File

@ -420,7 +420,7 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l
streamPacketIndex = videoPacket->streamPacketIndex;
// The packets and frames must be in sequence from the FEC queue
LC_ASSERT(!isBeforeSignedInt((short)streamPacketIndex, (short)(lastPacketInStream + 1), 0));
LC_ASSERT(!isBeforeSignedInt(streamPacketIndex, lastPacketInStream + 1, 0));
LC_ASSERT(!isBeforeSignedInt(frameIndex, nextFrameNumber, 0));
// Notify the listener of the latest frame we've seen from the PC
@ -452,10 +452,10 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l
// This must be the first packet in a frame or be contiguous with the last
// packet received.
LC_ASSERT(firstPacket || streamPacketIndex == (int)(lastPacketInStream + 1));
LC_ASSERT(firstPacket || streamPacketIndex == lastPacketInStream + 1);
// Notify the server of any packet losses
if (streamPacketIndex != (int)(lastPacketInStream + 1)) {
if (streamPacketIndex != lastPacketInStream + 1) {
// Packets were lost so report this to the server
connectionLostPackets(lastPacketInStream, streamPacketIndex);
}