mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
rtpsession: timeout internal sources that are inactive for a long time and send BYE
This commit is contained in:
parent
bcd469ff31
commit
0e6a31411b
1 changed files with 21 additions and 9 deletions
|
@ -3258,15 +3258,27 @@ session_cleanup (const gchar * key, RTPSource * source, ReportData * data)
|
||||||
byetimeout = TRUE;
|
byetimeout = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* sources that were inactive for more than 5 times the deterministic reporting
|
}
|
||||||
* interval get timed out. the min timeout is 5 seconds. */
|
|
||||||
/* mind old time that might pre-date last time going to PLAYING */
|
/* sources that were inactive for more than 5 times the deterministic reporting
|
||||||
btime = MAX (source->last_activity, sess->start_time);
|
* interval get timed out. the min timeout is 5 seconds. */
|
||||||
if (data->current_time > btime) {
|
/* mind old time that might pre-date last time going to PLAYING */
|
||||||
interval = MAX (binterval * 5, 5 * GST_SECOND);
|
btime = MAX (source->last_activity, sess->start_time);
|
||||||
if (data->current_time - btime > interval) {
|
if (data->current_time > btime) {
|
||||||
GST_DEBUG ("removing timeout source %08x, last %" GST_TIME_FORMAT,
|
interval = MAX (binterval * 5, 5 * GST_SECOND);
|
||||||
source->ssrc, GST_TIME_ARGS (btime));
|
if (data->current_time - btime > interval) {
|
||||||
|
GST_DEBUG ("removing timeout source %08x, last %" GST_TIME_FORMAT,
|
||||||
|
source->ssrc, GST_TIME_ARGS (btime));
|
||||||
|
if (source->internal) {
|
||||||
|
/* this is an internal source that is not using our suggested ssrc.
|
||||||
|
* since there must be another source using this ssrc, we can remove
|
||||||
|
* this one instead of making it a receiver forever */
|
||||||
|
if (source->ssrc != sess->suggested_ssrc) {
|
||||||
|
rtp_source_mark_bye (source, "timed out");
|
||||||
|
/* do not schedule bye here, since we are inside the RTCP timeout
|
||||||
|
* processing and scheduling bye will interfere with SR/RR sending */
|
||||||
|
}
|
||||||
|
} else {
|
||||||
remove = TRUE;
|
remove = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue