From 67b120d73c39723dddb37e806d7468f243830f88 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 30 Jun 2020 08:36:41 +0200 Subject: Fix RTP sequence number overflow check --- src/AVTInput.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/AVTInput.cpp b/src/AVTInput.cpp index 32f6518..0d6f229 100644 --- a/src/AVTInput.cpp +++ b/src/AVTInput.cpp @@ -218,7 +218,11 @@ const uint8_t* AVTInput::_findDABFrameFromUDP(const uint8_t* buf, size_t size, if (version == 2 && payloadType == 34) { const uint16_t seqnr = (buf[index+2] << 8) | buf[index+3]; if ((_previousRtpIndex != -1) and - (((_previousRtpIndex + 1) % 0xFFFF) != seqnr)) { + (((_previousRtpIndex + 1) % 5000) != seqnr)) { + /* the sequence number apparently overflows at 5000, even though + * RFC 3550 (RTP protocol) suggests that it should overflow at 0xFFFF. + * Maybe the AVT uses DLFC as RTP sequence number. + */ fprintf(stderr, "RTP sequence number jump from %d to %d\n", _previousRtpIndex, seqnr); } -- cgit v1.2.3