From 784f2bb8ef17dad5f8abbed2dfd232033343b1bc Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 1 Aug 2017 15:59:19 +0200 Subject: [PATCH] reset bandwidth controller between state and upon network changes --- coreapi/linphonecall.c | 3 +++ coreapi/linphonecore.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 8a93953ae..4471af2f1 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1721,6 +1721,9 @@ static void linphone_call_set_terminated(LinphoneCall *call){ if (call->chat_room){ call->chat_room->call = NULL; } + if (lc->calls == NULL){ + ms_bandwidth_controller_reset_state(lc->bw_controller); + } } /*function to be called at each incoming reINVITE, in order to adjust various local parameters to what is being offered by remote: diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index edb59eefe..28972673c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6218,6 +6218,9 @@ static void set_media_network_reachable(LinphoneCore* lc, bool_t is_media_reacha bctbx_list_for_each(lc->calls, (MSIterateFunc)linphone_call_refresh_sockets); } linphone_core_repair_calls(lc); + if (lc->bw_controller){ + ms_bandwidth_controller_reset_state(lc->bw_controller); + } } }