mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
rtpjitterbuffer: check some more for possible rtp timestamp discontinuity
... when operating in non slave mode, and reset if detected. This should avoid some (large) bogus outgoing timestamp due to jumps in rtp time, as result of PAUSE/PLAY or seek or ...
This commit is contained in:
parent
8599801cae
commit
1e17e10f75
1 changed files with 16 additions and 0 deletions
|
@ -634,6 +634,22 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, GstBuffer * buf,
|
|||
}
|
||||
|
||||
rtptime = gst_rtp_buffer_get_timestamp (buf);
|
||||
/* rtp time jumps are checked for during skew calculation, but bypassed
|
||||
* in other mode, so mind those here and reset jb if needed */
|
||||
if (jbuf->mode != RTP_JITTER_BUFFER_MODE_SLAVE &&
|
||||
jbuf->base_time != -1 && jbuf->last_rtptime != -1) {
|
||||
GstClockTime ext_rtptime = jbuf->ext_rtptime;
|
||||
|
||||
ext_rtptime = gst_rtp_buffer_ext_timestamp (&ext_rtptime, rtptime);
|
||||
if (ext_rtptime > jbuf->last_rtptime + 3 * clock_rate ||
|
||||
ext_rtptime + 3 * clock_rate < jbuf->last_rtptime) {
|
||||
/* reset even if we don't have valid incoming time;
|
||||
* still better than producing possibly very bogus output timestamp */
|
||||
GST_WARNING ("rtp delta too big, reset skew");
|
||||
rtp_jitter_buffer_reset_skew (jbuf);
|
||||
}
|
||||
}
|
||||
|
||||
switch (jbuf->mode) {
|
||||
case RTP_JITTER_BUFFER_MODE_NONE:
|
||||
case RTP_JITTER_BUFFER_MODE_BUFFER:
|
||||
|
|
Loading…
Reference in a new issue