aboutsummaryrefslogtreecommitdiffstats
path: root/src/AVTInput.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-06-29 17:06:43 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-06-29 17:06:43 +0200
commit35867ba39effd3c40b727e90163d406d4abcd2bf (patch)
treefc7c9f85d7fedf42134facb398c0021f7c914830 /src/AVTInput.cpp
parentbda603e4d1d963f499b2f1a13d16c5a23e9f0246 (diff)
downloadODR-SourceCompanion-35867ba39effd3c40b727e90163d406d4abcd2bf.tar.gz
ODR-SourceCompanion-35867ba39effd3c40b727e90163d406d4abcd2bf.tar.bz2
ODR-SourceCompanion-35867ba39effd3c40b727e90163d406d4abcd2bf.zip
Add RTP sequence number check
Diffstat (limited to 'src/AVTInput.cpp')
-rw-r--r--src/AVTInput.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/AVTInput.cpp b/src/AVTInput.cpp
index 955ca33..ab6be76 100644
--- a/src/AVTInput.cpp
+++ b/src/AVTInput.cpp
@@ -216,6 +216,14 @@ const uint8_t* AVTInput::_findDABFrameFromUDP(const uint8_t* buf, size_t size,
uint32_t version = (buf[index] & 0xC0) >> 6;
uint32_t payloadType = (buf[index+1] & 0x7F);
if (version == 2 && payloadType == 34) {
+ const uint16_t seqnr = (buf[index+2] << 8) | buf[index+3];
+ if ((_previousRtpIndex != -1) and
+ (((_previousRtpIndex + 1) % 0xFFFF) != seqnr)) {
+ fprintf(stderr, "RTP sequence number jump from %d to %d\n",
+ _previousRtpIndex, seqnr);
+ }
+ _previousRtpIndex = seqnr;
+
#if 0
// If one wants to decode the RTP timestamp, here is some
// example code. The AVT generates a timestamp which starts