From 93f93847e8f538f5c76ed4e0788d691f708c6524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 4 Apr 2024 13:19:18 +0300 Subject: [PATCH] rtpbin: Convert clock-base to extended RTP timestamp correctly It's not in the same period as the current RTP base time but always in the very first period. This avoids using it again at a much later time. The code in question is only triggered with rtcp-sync=rtp-info. Part-of: --- subprojects/gst-plugins-good/gst/rtpmanager/gstrtpbin.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpbin.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpbin.c index 0fbf0820c1..66ba0d37a2 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpbin.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpbin.c @@ -1588,13 +1588,12 @@ gst_rtp_bin_associate (GstRtpBin * bin, GstRtpBinStream * stream, guint8 len, min = rtp_min = G_MAXINT64; use_rtp = FALSE; if (rtcp_sync == GST_RTP_BIN_RTCP_SYNC_RTP) { - guint64 ext_base; + guint64 ext_base = -1; use_rtp = TRUE; /* signed version for convenience */ clock_base = base_rtptime; - /* deal with possible wrap-around */ - ext_base = base_rtptime; + /* convert to extended RTP time */ rtp_clock_base = gst_rtp_buffer_ext_timestamp (&ext_base, rtp_clock_base); /* sanity check; base rtp and provided clock_base should be close */ if (rtp_clock_base >= clock_base) {