You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Boolean seqNumLT(u_int16_t s1, u_int16_t s2) {
// a 'less-than' on 16-bit sequence numbers
int diff = s2 - s1;
if (diff > 0) {
return (diff < 0x8000);
} else if (diff < 0) {
return (diff < -0x8000);
} else { // diff == 0
return False;
}
}
The line return (diff < -0x8000); is intended to determine if s1 has rolled over when s1 is greater than s2.
When the diff value is smaller, it does not necessarily imply a 'less-than' condition but rather a rollover situation.
Therefore, it seems correct to modify this line to return (diff >= -0x8000); to accurately reflect the condition being checked.
The text was updated successfully, but these errors were encountered:
Hi bro!
I think you're wrong,, you not get what's the function of seqNumLT, it just judges if s1 is less than s2, if s2 is next
expected Seq in RTP packet, the value is 2, but s1 is a real RTP packet maybe the value is 0xffff - 0x0003(maybe previous packet reached),the diff between s2 and s1 is less than -0x8000, so we need to ignore it!!! (your best friend from CHINA Hope it is useful for you)
The seqNumLT function source is as follows:
Boolean seqNumLT(u_int16_t s1, u_int16_t s2) {
// a 'less-than' on 16-bit sequence numbers
int diff = s2 - s1;
if (diff > 0) {
return (diff < 0x8000);
} else if (diff < 0) {
return (diff < -0x8000);
} else { // diff == 0
return False;
}
}
The line return (diff < -0x8000); is intended to determine if s1 has rolled over when s1 is greater than s2.
When the diff value is smaller, it does not necessarily imply a 'less-than' condition but rather a rollover situation.
Therefore, it seems correct to modify this line to return (diff >= -0x8000); to accurately reflect the condition being checked.
The text was updated successfully, but these errors were encountered: