summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-03-09 10:12:46 (GMT)
committerSebastian Dröge <sebastian@centricular.com>2015-03-09 10:12:46 (GMT)
commit8f13a31bae97722c96dda40dd628bcc801dba7e5 (patch)
tree5622fa78e7ec11fb17f77d553d3c4f725cd78e92
parentf134072c66783bf5db5ff5481903a2afa1fac317 (diff)
downloadgst-plugins-base-8f13a31bae97722c96dda40dd628bcc801dba7e5.tar.gz
gst-plugins-base-8f13a31bae97722c96dda40dd628bcc801dba7e5.tar.xz
rtpbuffer: Link to an explanation why the seqnum comparison function does the right thing even for wraparounds
-rw-r--r--gst-libs/gst/rtp/gstrtpbuffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c
index af39823..f479637 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);
}