rtpjitterbuffer.c: calculate_skew should respect to the latency proerty

cee1 fykcee1 at gmail.com
Mon Feb 11 21:25:39 PST 2013


Hi all,

calculate_skew will calculate a "correct timestamp"(a ts which has a
constant offset to the ts of rtp server) in slave mode.
However its calculation doesn't respect to the latency property:
E.g. if I set latency more than 1s, that means data may be delayed
more than 1s, which cause a rtp_jitter_buffer_resync because "delta -
skew:  >1s too big, reset skew".

Following is an example patch for this:
diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c
index 3a2423e..d06d321 100644
--- a/gst/rtpmanager/rtpjitterbuffer.c
+++ b/gst/rtpmanager/rtpjitterbuffer.c
@@ -456,7 +456,7 @@ calculate_skew (RTPJitterBuffer * jbuf, guint32
rtptime, GstClockTime time,
   /* if the difference between the sender timeline and the receiver timeline
    * changed too quickly we have to resync because the server likely restarted
    * its timestamps. */
-  if (ABS (delta - jbuf->skew) > GST_SECOND) {
+  if (ABS (delta - jbuf->skew) > jbuf->delay) {
     GST_WARNING ("delta - skew: %" GST_TIME_FORMAT " too big, reset skew",
         GST_TIME_ARGS (ABS (delta - jbuf->skew)));
     rtp_jitter_buffer_resync (jbuf, time, gstrtptime, ext_rtptime, TRUE);

Any ideas?


-- 
Regards,

- cee1


More information about the gstreamer-devel mailing list