From 8f13a31bae97722c96dda40dd628bcc801dba7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 9 Mar 2015 11:12:46 +0100 Subject: [PATCH] rtpbuffer: Link to an explanation why the seqnum comparison function does the right thing even for wraparounds --- gst-libs/gst/rtp/gstrtpbuffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c index af398235da..f479637cd3 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.c +++ b/gst-libs/gst/rtp/gstrtpbuffer.c @@ -1212,6 +1212,11 @@ gst_rtp_buffer_default_clock_rate (guint8 payload_type) gint gst_rtp_buffer_compare_seqnum (guint16 seqnum1, guint16 seqnum2) { + /* See http://en.wikipedia.org/wiki/Serial_number_arithmetic + * for an explanation why this does the right thing even for + * wraparounds, under the assumption that the difference is + * never bigger than 2**15 sequence numbers + */ return (gint16) (seqnum2 - seqnum1); }