jitterbuffer: don't resync to invalid timestamps

If we detect backward timestamps on the server, don't try to resync when we
don't have an input timestamp (such as when using RTSP over TCP) instead, do
nothing but assume the timestamp was ok, it will correct itself when time goes
forwards.
This commit is contained in:
Wim Taymans 2010-02-12 19:32:27 +01:00
parent d344754f03
commit 7f08081016

View file

@ -381,12 +381,15 @@ calculate_skew (RTPJitterBuffer * jbuf, guint32 rtptime, GstClockTime time,
if (G_LIKELY (gstrtptime >= jbuf->base_rtptime))
send_diff = gstrtptime - jbuf->base_rtptime;
else {
else if (time != -1) {
/* elapsed time at sender, timestamps can go backwards and thus be smaller
* than our base time, take a new base time in that case. */
GST_WARNING ("backward timestamps at server, taking new base time");
rtp_jitter_buffer_resync (jbuf, time, gstrtptime, ext_rtptime, FALSE);
send_diff = 0;
} else {
GST_WARNING ("backward timestamps at server but no timestamps");
send_diff = 0;
}
GST_DEBUG ("extrtp %" G_GUINT64_FORMAT ", gstrtp %" GST_TIME_FORMAT ", base %"