--- gstrtpjitterbuffer.c.orig	2014-02-25 09:59:52 -0500
+++ gstrtpjitterbuffer.c	2014-02-25 10:07:12 -0500
@@ -2008,7 +2008,7 @@
     type = TIMER_TYPE_LOST;
   }
 
-  while (expected < seqnum) {
+  while (gst_rtp_buffer_compare_seqnum (expected, seqnum) > 0) {
     add_timer (jitterbuffer, type, expected, 0, expected_dts, 0, duration);
     expected_dts += duration;
     expected++;
@@ -2859,7 +2859,7 @@
       } else if (timer_timeout == -1) {
         /* we already have an immediate timeout, the new timer must be an
          * immediate timer with smaller seqnum to become the best */
-        if (test_timeout == -1 && test->seqnum < timer->seqnum)
+		if (test_timeout == -1 && (gst_rtp_buffer_compare_seqnum (test->seqnum, timer->seqnum) > 0))
           save_best = TRUE;
       } else if (test_timeout == -1) {
         /* first immediate timer */
@@ -2867,7 +2867,7 @@
       } else if (test_timeout < timer_timeout) {
         /* earlier timer */
         save_best = TRUE;
-      } else if (test_timeout == timer_timeout && test->seqnum < timer->seqnum) {
+	  } else if (test_timeout == timer_timeout && (gst_rtp_buffer_compare_seqnum (test->seqnum < timer->seqnum) > 0)) {
         /* same timer, smaller seqnum */
         save_best = TRUE;
       }
