summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-05-07 13:32:30 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2010-05-07 13:32:30 +0200
commit6eee730c4afb2fe404a742d85d1dd279a6e2b45e (patch)
tree28aade074ca95ef9443b6c3617ac37950c38f970
parentdb3c4e7f467db32acb3351935189cd3f3d071eba (diff)
rtpsession: handle NONE RTCP intervals
Prepare for handling RTCP reporting intervals of GST_CLOCK_TIME_NONE, which means don't send RTCP at all.
-rw-r--r--gst/rtpmanager/rtpsession.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index 8ffb5a4db..2befbcdc5 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -2135,7 +2135,7 @@ rtp_session_schedule_bye (RTPSession * sess, const gchar * reason,
GstClockTime
rtp_session_next_timeout (RTPSession * sess, GstClockTime current_time)
{
- GstClockTime result;
+ GstClockTime result, interval = 0;
g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);
@@ -2156,23 +2156,29 @@ rtp_session_next_timeout (RTPSession * sess, GstClockTime current_time)
if (sess->source->received_bye) {
if (sess->sent_bye) {
GST_DEBUG ("we sent BYE already");
- result = GST_CLOCK_TIME_NONE;
+ interval = GST_CLOCK_TIME_NONE;
} else if (sess->stats.active_sources >= 50) {
GST_DEBUG ("reconsider BYE, more than 50 sources");
/* reconsider BYE if members >= 50 */
- result += calculate_rtcp_interval (sess, FALSE, TRUE);
+ interval = calculate_rtcp_interval (sess, FALSE, TRUE);
}
} else {
if (sess->first_rtcp) {
GST_DEBUG ("first RTCP packet");
/* we are called for the first time */
- result += calculate_rtcp_interval (sess, FALSE, TRUE);
+ interval = calculate_rtcp_interval (sess, FALSE, TRUE);
} else if (sess->next_rtcp_check_time < current_time) {
GST_DEBUG ("old check time expired, getting new timeout");
/* get a new timeout when we need to */
- result += calculate_rtcp_interval (sess, FALSE, FALSE);
+ interval = calculate_rtcp_interval (sess, FALSE, FALSE);
}
}
+
+ if (interval != GST_CLOCK_TIME_NONE)
+ result += interval;
+ else
+ result = GST_CLOCK_TIME_NONE;
+
sess->next_rtcp_check_time = result;
GST_DEBUG ("next timeout: %" GST_TIME_FORMAT, GST_TIME_ARGS (result));