From 86d007a5531a347bc028d989963530f0cc15bc6c Mon Sep 17 00:00:00 2001 From: Marcel Moreaux Date: Wed, 2 Aug 2006 17:03:29 +0000 Subject: [PATCH] gst-libs/gst/rtp/gstbasertpdepayload.*: Handle RTP sequence number rollover. Original commit message from CVS: Patch by: Marcel Moreaux * gst-libs/gst/rtp/gstbasertpdepayload.c: (gst_base_rtp_depayload_add_to_queue): * gst-libs/gst/rtp/gstbasertpdepayload.h: Handle RTP sequence number rollover. Disable jitterbuffer by default. --- ChangeLog | 10 ++++++++++ gst-libs/gst/rtp/gstbasertpdepayload.c | 5 ++++- gst-libs/gst/rtp/gstbasertpdepayload.h | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c49f36727b..47e3f10769 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-08-02 Wim Taymans + + Patch by: Marcel Moreaux + + * gst-libs/gst/rtp/gstbasertpdepayload.c: + (gst_base_rtp_depayload_add_to_queue): + * gst-libs/gst/rtp/gstbasertpdepayload.h: + Handle RTP sequence number rollover. + Disable jitterbuffer by default. + 2006-07-28 Jan Schmidt * gst/audioresample/gstaudioresample.c: (audioresample_stop), diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c index df13a52c95..abb7e111e1 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.c +++ b/gst-libs/gst/rtp/gstbasertpdepayload.c @@ -300,7 +300,10 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter, /* look for right place to insert it */ i = 0; - while (seqnum > queueseq) { + /* Check for seqnum wraparound. + * Seqnums in the lowest quadrant of the 0-65535 space are considered to + * be greater than seqnums in the highest quadrant of this space. */ + while (seqnum > queueseq || (seqnum < 16384 && queueseq > 49150)) { gpointer data; i++; diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.h b/gst-libs/gst/rtp/gstbasertpdepayload.h index f28aaaae75..15d7c50839 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.h +++ b/gst-libs/gst/rtp/gstbasertpdepayload.h @@ -42,7 +42,7 @@ G_BEGIN_DECLS #define GST_BASE_RTP_DEPAYLOAD_SRCPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->srcpad) /* in milliseconds */ -#define RTP_QUEUE_DELAY 100; +#define RTP_QUEUE_DELAY 0; #define QUEUE_LOCK_INIT(base) (g_static_rec_mutex_init(&base->queuelock)) #define QUEUE_LOCK_FREE(base) (g_static_rec_mutex_free(&base->queuelock))