rtpbuffer: Link to an explanation why the seqnum comparison function does the right...
authorSebastian Dröge <sebastian@centricular.com>
Mon, 9 Mar 2015 10:12:46 +0000 (11:12 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 9 Mar 2015 10:12:46 +0000 (11:12 +0100)
gst-libs/gst/rtp/gstrtpbuffer.c

index af398235da95799c4d057378e4dcb487564b3a19..f479637cd3fa62d2c45c0937e32ad3f8b0c29b2e 100644 (file)
@@ -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);
 }