@@ -1848,7 +1848,7 @@ kms_base_rtp_endpoint_update_sync_data (KmsBaseRtpEndpoint * self,
1848
1848
1849
1849
static GstClockTime
1850
1850
kms_base_rtp_endpoint_calculate_new_pts (KmsBaseRtpEndpoint * self ,
1851
- SsrcSyncData * sync_data , GstClockTime buffer_pts )
1851
+ SsrcSyncData * sync_data , GstClockTime buffer_pts , GstClockTime buffer_dts )
1852
1852
{
1853
1853
GstClockTime pts , diff_ntpnstime , diff_rtptime , diff_rtpnstime ;
1854
1854
gboolean wrapped_down , wrapped_up , is_lower ;
@@ -1900,7 +1900,7 @@ kms_base_rtp_endpoint_calculate_new_pts (KmsBaseRtpEndpoint * self,
1900
1900
}
1901
1901
}
1902
1902
1903
- if (pts > (3 * buffer_pts )) {
1903
+ if (pts > (buffer_dts + ( JB_READY_VIDEO_LATENCY * GST_MSECOND * 2 ) )) {
1904
1904
GST_WARNING_OBJECT (self , "Wrong calculated pts %" G_GUINT64_FORMAT
1905
1905
" . Using buffer pts %" G_GUINT64_FORMAT , pts , buffer_pts );
1906
1906
GST_WARNING_OBJECT (self , "Data used: base_sync_time %" G_GUINT64_FORMAT
@@ -1973,7 +1973,7 @@ timestamps_probe (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
1973
1973
// Perform bufffer synchronization
1974
1974
buff = gst_buffer_make_writable (buff );
1975
1975
GST_BUFFER_PTS (buff ) = kms_base_rtp_endpoint_calculate_new_pts (self ,
1976
- sync_data , buff -> pts );
1976
+ sync_data , buff -> pts , buff -> dts );
1977
1977
sync_data -> last_ext_ts = sync_data -> ext_ts ;
1978
1978
}
1979
1979
0 commit comments