rtpjitterbuffer: Fix calculation of reference timestamp metadata

Add support for RTCP SRs that contain RTP timestamps later than the
current timestamps in the RTP stream packet buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3019>
This commit is contained in:
Matt Crane 2022-09-12 14:18:47 -04:00 committed by GStreamer Marge Bot
parent 6a8a20ff92
commit e64a5b9a85

View file

@ -3489,9 +3489,16 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
ext_time = gst_rtp_buffer_ext_timestamp (&ext_time, rtptime);
ntp_time =
priv->last_known_ntpnstime + gst_util_uint64_scale (ext_time -
priv->last_known_ext_rtptime, GST_SECOND, priv->clock_rate);
if (ext_time >= priv->last_known_ext_rtptime) {
ntp_time =
priv->last_known_ntpnstime + gst_util_uint64_scale (ext_time -
priv->last_known_ext_rtptime, GST_SECOND, priv->clock_rate);
} else {
ntp_time =
priv->last_known_ntpnstime -
gst_util_uint64_scale (priv->last_known_ext_rtptime - ext_time,
GST_SECOND, priv->clock_rate);
}
}
if (priv->add_reference_timestamp_meta && GST_CLOCK_TIME_IS_VALID (ntp_time)