changeset 207:10f11a2d4042

pcap utils: fix bug in the case of RTP timestamp 16-bit rollover
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 17 Feb 2023 19:56:45 +0000
parents 1b8cb3490d48
children 13d27ff5b5df
files pcap/rtp-cont-check.c pcap/rtp-g711-extr.c pcap/rtp-gsmfr-extr.c pcap/rtp-jitter-view.c
diffstat 4 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pcap/rtp-cont-check.c	Wed Jan 04 07:53:16 2023 +0000
+++ b/pcap/rtp-cont-check.c	Fri Feb 17 19:56:45 2023 +0000
@@ -80,7 +80,8 @@
 				pkt_idx, stream_ssrc, cur_ssrc);
 			exit(1);
 		}
-		if (cur_seq != last_seq + 1) {
+		if (cur_seq != last_seq + 1 &&
+		    (cur_seq != 0 || last_seq != 0xFFFF)) {
 			fprintf(stderr,
 		"error in packet #%u: seq break from 0x%04X to 0x%04X\n",
 				pkt_idx, last_seq, cur_seq);
--- a/pcap/rtp-g711-extr.c	Wed Jan 04 07:53:16 2023 +0000
+++ b/pcap/rtp-g711-extr.c	Fri Feb 17 19:56:45 2023 +0000
@@ -71,7 +71,8 @@
 				pkt_idx, stream_ssrc, cur_ssrc);
 			exit(1);
 		}
-		if (cur_seq != last_seq + 1) {
+		if (cur_seq != last_seq + 1 &&
+		    (cur_seq != 0 || last_seq != 0xFFFF)) {
 			fprintf(stderr,
 		"error in packet #%u: seq break from 0x%04X to 0x%04X\n",
 				pkt_idx, last_seq, cur_seq);
--- a/pcap/rtp-gsmfr-extr.c	Wed Jan 04 07:53:16 2023 +0000
+++ b/pcap/rtp-gsmfr-extr.c	Fri Feb 17 19:56:45 2023 +0000
@@ -70,7 +70,8 @@
 				pkt_idx, stream_ssrc, cur_ssrc);
 			exit(1);
 		}
-		if (cur_seq != last_seq + 1) {
+		if (cur_seq != last_seq + 1 &&
+		    (cur_seq != 0 || last_seq != 0xFFFF)) {
 			fprintf(stderr,
 		"error in packet #%u: seq break from 0x%04X to 0x%04X\n",
 				pkt_idx, last_seq, cur_seq);
--- a/pcap/rtp-jitter-view.c	Wed Jan 04 07:53:16 2023 +0000
+++ b/pcap/rtp-jitter-view.c	Fri Feb 17 19:56:45 2023 +0000
@@ -80,7 +80,8 @@
 				pkt_idx, stream_ssrc, cur_ssrc);
 			exit(1);
 		}
-		if (cur_seq != last_seq + 1) {
+		if (cur_seq != last_seq + 1 &&
+		    (cur_seq != 0 || last_seq != 0xFFFF)) {
 			fprintf(stderr,
 		"error in packet #%u: seq break from 0x%04X to 0x%04X\n",
 				pkt_idx, last_seq, cur_seq);