Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avformat/rtpdec: Fix negative missed packets in warning message
@ 2022-01-23  3:51 lance.lmwang
  2022-01-23  3:51 ` [FFmpeg-devel] [PATCH 2/3] avformat/rtpdec: return value check for init_get_bits() lance.lmwang
  2022-01-23  3:51 ` [FFmpeg-devel] [PATCH 3/3] avformat/dashdec: avoid calling strlen multiple times lance.lmwang
  0 siblings, 2 replies; 5+ messages in thread
From: lance.lmwang @ 2022-01-23  3:51 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Limin Wang

From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/rtpdec.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 20fe2b8..f285a41 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);
-- 
1.8.3.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-30  5:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23  3:51 [FFmpeg-devel] [PATCH 1/3] avformat/rtpdec: Fix negative missed packets in warning message lance.lmwang
2022-01-23  3:51 ` [FFmpeg-devel] [PATCH 2/3] avformat/rtpdec: return value check for init_get_bits() lance.lmwang
2022-01-23  3:51 ` [FFmpeg-devel] [PATCH 3/3] avformat/dashdec: avoid calling strlen multiple times lance.lmwang
2022-01-24  3:48   ` Steven Liu
2022-01-30  5:40     ` lance.lmwang

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git