session: remove internal sources on timeout
When an internal source times out and becomes a receiver, remove it.
This commit is contained in:
parent
e9e2fe3950
commit
e952f7ba43
@ -2857,7 +2857,6 @@ session_cleanup (const gchar * key, RTPSource * source, ReportData * data)
|
|||||||
GST_LOG ("timeout base interval %" GST_TIME_FORMAT,
|
GST_LOG ("timeout base interval %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (binterval));
|
GST_TIME_ARGS (binterval));
|
||||||
|
|
||||||
/* FIXME, we need to remove internal sources too */
|
|
||||||
if (!source->internal) {
|
if (!source->internal) {
|
||||||
if (source->marked_bye) {
|
if (source->marked_bye) {
|
||||||
/* if we received a BYE from the source, remove the source after some
|
/* if we received a BYE from the source, remove the source after some
|
||||||
@ -2891,16 +2890,19 @@ session_cleanup (const gchar * key, RTPSource * source, ReportData * data)
|
|||||||
if (data->current_time > btime) {
|
if (data->current_time > btime) {
|
||||||
interval = MAX (binterval * 2, 5 * GST_SECOND);
|
interval = MAX (binterval * 2, 5 * GST_SECOND);
|
||||||
if (data->current_time - btime > interval) {
|
if (data->current_time - btime > interval) {
|
||||||
|
if (source->internal && source->sent_bye) {
|
||||||
|
/* an internal source is BYE and stopped sending RTP, remove */
|
||||||
|
GST_DEBUG ("internal BYE source %08x timed out, last %"
|
||||||
|
GST_TIME_FORMAT, source->ssrc, GST_TIME_ARGS (btime));
|
||||||
|
remove = TRUE;
|
||||||
|
} else {
|
||||||
GST_DEBUG ("sender source %08x timed out and became receiver, last %"
|
GST_DEBUG ("sender source %08x timed out and became receiver, last %"
|
||||||
GST_TIME_FORMAT, source->ssrc, GST_TIME_ARGS (btime));
|
GST_TIME_FORMAT, source->ssrc, GST_TIME_ARGS (btime));
|
||||||
source->is_sender = FALSE;
|
|
||||||
sess->stats.sender_sources--;
|
|
||||||
if (source->internal)
|
|
||||||
sess->stats.internal_sender_sources--;
|
|
||||||
sendertimeout = TRUE;
|
sendertimeout = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (remove) {
|
if (remove) {
|
||||||
sess->total_sources--;
|
sess->total_sources--;
|
||||||
@ -2920,9 +2922,15 @@ session_cleanup (const gchar * key, RTPSource * source, ReportData * data)
|
|||||||
else
|
else
|
||||||
on_timeout (sess, source);
|
on_timeout (sess, source);
|
||||||
} else {
|
} else {
|
||||||
if (sendertimeout)
|
if (sendertimeout) {
|
||||||
|
source->is_sender = FALSE;
|
||||||
|
sess->stats.sender_sources--;
|
||||||
|
if (source->internal)
|
||||||
|
sess->stats.internal_sender_sources--;
|
||||||
|
|
||||||
on_sender_timeout (sess, source);
|
on_sender_timeout (sess, source);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
source->closing = remove;
|
source->closing = remove;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user