summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2022-01-17 13:59:13 +0800
committerLimin Wang <lance.lmwang@gmail.com>2022-01-30 13:26:35 +0800
commitd9f05bea5cc7a8c4bb0569eecbe24a26def7f476 (patch)
tree36fefa1bbd20ba1d3b9f20951419ca5d14d13dae
parent98cef1ebbea61a605d151f5b46b453321e1b63a6 (diff)
avformat/rtpdec: Fix negative missed packets in warning message
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
-rw-r--r--libavformat/rtpdec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 20fe2b82d7..f285a41cf4 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -835,9 +835,14 @@ static int rtp_parse_queued_packet(RTPDemuxContext *s, AVPacket *pkt)
if (s->queue_len <= 0)
return -1;
- if (!has_next_packet(s))
+ if (!has_next_packet(s)) {
+ int pkt_missed = s->queue->seq - s->seq - 1;
+
+ if (pkt_missed < 0)
+ pkt_missed += UINT16_MAX;
av_log(s->ic, AV_LOG_WARNING,
- "RTP: missed %d packets\n", s->queue->seq - s->seq - 1);
+ "RTP: missed %d packets\n", pkt_missed);
+ }
/* Parse the first packet in the queue, and dequeue it */
rv = rtp_parse_packet_internal(s, pkt, s->queue->buf, s->queue->len);