diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-10-05 17:26:14 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-10-05 17:26:14 +0000 |
commit | f4b32ca36d25de8a7c07dd9262fb7ab35b5bcccc (patch) | |
tree | a353460f18227968ecd9e7c3647adacad26559ba /gst | |
parent | 6e5d23b3d7ab28343a29ff4af7dc65d6a31e79ae (diff) | |
download | gst-plugins-bad-f4b32ca36d25de8a7c07dd9262fb7ab35b5bcccc.tar.gz gst-plugins-bad-f4b32ca36d25de8a7c07dd9262fb7ab35b5bcccc.tar.bz2 gst-plugins-bad-f4b32ca36d25de8a7c07dd9262fb7ab35b5bcccc.zip |
gst/rtpmanager/rtpsession.c: When reconsidering RTCP timeouts, set the next timeout against the last report time inst...
Original commit message from CVS:
* gst/rtpmanager/rtpsession.c: (rtp_session_next_timeout),
When reconsidering RTCP timeouts, set the next timeout against the last
report time instead of the current clock time so that we don't end up
reconsidering forever.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtpmanager/rtpsession.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index 0f907efd..628147df 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -1569,19 +1569,35 @@ rtp_session_next_timeout (RTPSession * sess, GstClockTime time) result = sess->next_rtcp_check_time; + GST_DEBUG ("current time: %" GST_TIME_FORMAT ", next :%" GST_TIME_FORMAT, + GST_TIME_ARGS (time), GST_TIME_ARGS (result)); + + if (result < time) { + GST_DEBUG ("take current time as base"); + /* our previous check time expired, start counting from the current time + * again. */ + result = time; + } + if (sess->source->received_bye) { - if (sess->sent_bye) + if (sess->sent_bye) { + GST_DEBUG ("we sent BYE already"); result = GST_CLOCK_TIME_NONE; - else if (sess->stats.active_sources >= 50) + } else if (sess->stats.active_sources >= 50) { + GST_DEBUG ("reconsider BYE, more than 50 sources"); /* reconsider BYE if members >= 50 */ - result = time + calculate_rtcp_interval (sess, FALSE, TRUE); + result += calculate_rtcp_interval (sess, FALSE, TRUE); + } } else { - if (sess->first_rtcp) + if (sess->first_rtcp) { + GST_DEBUG ("first RTCP packet"); /* we are called for the first time */ - result = time + calculate_rtcp_interval (sess, FALSE, TRUE); - else if (sess->next_rtcp_check_time < time) + result += calculate_rtcp_interval (sess, FALSE, TRUE); + } else if (sess->next_rtcp_check_time < time) { + GST_DEBUG ("old check time expired, getting new timeout"); /* get a new timeout when we need to */ - result = time + calculate_rtcp_interval (sess, FALSE, FALSE); + result += calculate_rtcp_interval (sess, FALSE, FALSE); + } } sess->next_rtcp_check_time = result; @@ -1784,20 +1800,25 @@ session_bye (RTPSession * sess, ReportData * data) static gboolean is_rtcp_time (RTPSession * sess, GstClockTime time, ReportData * data) { - GstClockTime new_send_time; + GstClockTime new_send_time, elapsed; gboolean result; /* no need to check yet */ if (sess->next_rtcp_check_time > time) { - GST_DEBUG ("no check time yet"); + GST_DEBUG ("no check time yet, next %" GST_TIME_FORMAT " > now %" + GST_TIME_FORMAT, GST_TIME_ARGS (sess->next_rtcp_check_time), + GST_TIME_ARGS (time)); return FALSE; } + /* get elapsed time since we last reported */ + elapsed = time - sess->last_rtcp_send_time; + /* perform forward reconsideration */ new_send_time = rtp_stats_add_rtcp_jitter (&sess->stats, data->interval); - GST_DEBUG ("forward reconsideration %" GST_TIME_FORMAT, - GST_TIME_ARGS (new_send_time)); + GST_DEBUG ("forward reconsideration %" GST_TIME_FORMAT ", elapsed %" + GST_TIME_FORMAT, GST_TIME_ARGS (new_send_time), GST_TIME_ARGS (elapsed)); new_send_time += sess->last_rtcp_send_time; |