summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-07-17 16:01:24 +0000
committerJoshua Colp <jcolp@digium.com>2017-07-19 13:23:26 +0000
commit680c491a6238274132bff3608ae17b1371c2af2a (patch)
treef46bcf51b940482bdde1f7496842cdac312b4a59 /bridges
parent47084ad09e30ad75a97500de7378414edccc01c0 (diff)
bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues.
This change does a few things to improve packet loss and renegotiation: 1. On outgoing RTP streams we will now properly reflect out of order packets and packet loss in the sequence number. This allows the remote jitterbuffer to better reorder things. 2. Video updates can now be discarded for a period of time after one has been sent to prevent flooding of clients. 3. For declined and removed streams we will now release any media session resources associated with them. This was not previously done and caused an issue where old state was being used for a new stream. 4. RTP bundling was not actually removing bundled RTP instances from the parent. This has been resolved by removing based on the RTP instance itself and not the SSRC. 5. The code did not properly handle explicitly unbundling an RTP instance from its parent. This now works as expected. ASTERISK-27143 Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45
Diffstat (limited to 'bridges')
-rw-r--r--bridges/bridge_softmix.c8
-rw-r--r--bridges/bridge_softmix/include/bridge_softmix_internal.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 3dd26603e..132ff0822 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -968,6 +968,8 @@ static void softmix_bridge_write_voice(struct ast_bridge *bridge, struct ast_bri
*/
static int softmix_bridge_write_control(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
{
+ struct softmix_bridge_data *softmix_data = bridge->tech_pvt;
+
/*
* XXX Softmix needs to use channel roles to determine what to
* do with control frames.
@@ -975,7 +977,11 @@ static int softmix_bridge_write_control(struct ast_bridge *bridge, struct ast_br
switch (frame->subclass.integer) {
case AST_CONTROL_VIDUPDATE:
- ast_bridge_queue_everyone_else(bridge, NULL, frame);
+ if (!bridge->softmix.video_mode.video_update_discard ||
+ ast_tvdiff_ms(ast_tvnow(), softmix_data->last_video_update) > bridge->softmix.video_mode.video_update_discard) {
+ ast_bridge_queue_everyone_else(bridge, NULL, frame);
+ softmix_data->last_video_update = ast_tvnow();
+ }
break;
default:
break;
diff --git a/bridges/bridge_softmix/include/bridge_softmix_internal.h b/bridges/bridge_softmix/include/bridge_softmix_internal.h
index 9daae4ce8..f93e66391 100644
--- a/bridges/bridge_softmix/include/bridge_softmix_internal.h
+++ b/bridges/bridge_softmix/include/bridge_softmix_internal.h
@@ -198,6 +198,8 @@ struct softmix_bridge_data {
* (does not guarantee success)
*/
unsigned int binaural_init;
+ /*! The last time a video update was sent into the bridge */
+ struct timeval last_video_update;
};
struct softmix_mixing_array {