fix crash with ICE scenario

This commit is contained in:
Simon Morlat 2015-04-17 18:37:28 +02:00
parent f53864f9c0
commit 5913eff7a5
3 changed files with 8 additions and 4 deletions

View file

@ -3795,7 +3795,7 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call,
}
linphone_call_update_remote_session_id_and_ver(call);
linphone_call_stop_ice_for_inactive_streams(call->localdesc, call->ice_session);
linphone_call_stop_ice_for_inactive_streams(call);
sal_call_accept(call->op);
linphone_core_notify_display_status(lc,_("Connected."));
lc->current_call=call;

View file

@ -59,6 +59,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define RTP_HDR_SZ 12
#define IP4_HDR_SZ 20 /*20 is the minimum, but there may be some options*/
static void clear_ice_check_list(LinphoneCall *call, IceCheckList *removed);
bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const LinphonePayloadType *pt){
if (ms_list_find(lc->codecs_conf.audio_codecs, (PayloadType*) pt) || ms_list_find(lc->codecs_conf.video_codecs, (PayloadType*)pt)){
@ -716,9 +717,11 @@ void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call)
linphone_ice_state_to_string(call->stats[LINPHONE_CALL_STATS_AUDIO].ice_state), linphone_ice_state_to_string(call->stats[LINPHONE_CALL_STATS_VIDEO].ice_state));
}
void linphone_call_stop_ice_for_inactive_streams(SalMediaDescription *desc, IceSession *session) {
void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call) {
int i;
IceSession *session = call->ice_session;
SalMediaDescription *desc = call->localdesc;
if (session == NULL) return;
if (ice_session_state(session) == IS_Completed) return;
@ -726,6 +729,7 @@ void linphone_call_stop_ice_for_inactive_streams(SalMediaDescription *desc, IceS
IceCheckList *cl = ice_session_check_list(session, i);
if (!sal_stream_description_active(&desc->streams[i]) && cl) {
ice_session_remove_check_list(session, cl);
clear_ice_check_list(call, cl);
}
}
}

View file

@ -396,7 +396,7 @@ void linphone_core_adapt_to_network(LinphoneCore *lc, int ping_time_ms, Linphone
int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call);
void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call);
void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEvent *ev);
void linphone_call_stop_ice_for_inactive_streams(SalMediaDescription *desc, IceSession *session);
void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call);
void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session);
void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall *call);
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);