rtpsession: Fix early rtcp time comparision
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 29 Mar 2019 20:49:37 +0000 (16:49 -0400)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Fri, 5 Apr 2019 14:53:09 +0000 (14:53 +0000)
If the current time is equal to the early rtcp time deadline, there is
no need to schedule a timer. This ensure that immediate feedback is
really immediate and simplify implementing unit tests with the test
clock, which stops perfectly on the timeout time.

This fix has been extracted from Pexip feature patch called
  "rtpsession: Allow instant transmission of RTCP packets"

gst/rtpmanager/rtpsession.c

index 1754d69..ccbaea2 100644 (file)
@@ -3854,8 +3854,8 @@ is_rtcp_time (RTPSession * sess, GstClockTime current_time, ReportData * data)
   else
     data->is_early = FALSE;
 
-  if (data->is_early && sess->next_early_rtcp_time < current_time) {
-    GST_DEBUG ("early feedback %" GST_TIME_FORMAT " < now %"
+  if (data->is_early && sess->next_early_rtcp_time <= current_time) {
+    GST_DEBUG ("early feedback %" GST_TIME_FORMAT " <= now %"
         GST_TIME_FORMAT, GST_TIME_ARGS (sess->next_early_rtcp_time),
         GST_TIME_ARGS (current_time));
   } else if (sess->next_rtcp_check_time == GST_CLOCK_TIME_NONE ||