From 470227cf85c4758eae07af53b86a23cdc9aa56f1 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 7 Oct 2013 11:48:51 +0200 Subject: [PATCH] fix ICE crash fix potential crash when opening property box --- coreapi/callbacks.c | 3 +-- coreapi/misc.c | 6 ++++++ gtk/propertybox.c | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 7d437cf69..d41091834 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -121,8 +121,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia } ms_message("No need to restart streams, SDP is unchanged."); return; - } - else { + }else { if (md_changed & SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED) { ms_message("Network parameters have changed, update them."); linphone_core_update_streams_destinations(lc, call, oldmd, new_md); diff --git a/coreapi/misc.c b/coreapi/misc.c index e88538fb3..671a719a2 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -962,6 +962,12 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call, ice_check_list_set_state(cl, ICL_Failed); } else if (stream->rtp_port == 0) { ice_session_remove_check_list(call->ice_session, cl); +#ifdef VIDEO_ENABLED + if (stream->type==SalVideo && call->videostream){ + video_stream_stop(call->videostream); + call->videostream=NULL; + } +#endif } else { if ((stream->ice_pwd[0] != '\0') && (stream->ice_ufrag[0] != '\0')) ice_check_list_set_remote_credentials(cl, stream->ice_ufrag, stream->ice_pwd); diff --git a/gtk/propertybox.c b/gtk/propertybox.c index 22c3813c4..bcdb52812 100644 --- a/gtk/propertybox.c +++ b/gtk/propertybox.c @@ -1051,6 +1051,7 @@ void linphone_gtk_fill_video_renderers(GtkWidget *pb){ MSList *l=ms_filter_lookup_by_interface(MSFilterVideoDisplayInterface); MSList *elem; int i; + int active=-1; const char *current_renderer=linphone_core_get_video_display_filter(lc); GtkListStore *store; GtkCellRenderer *renderer=gtk_cell_renderer_text_new(); @@ -1067,10 +1068,10 @@ void linphone_gtk_fill_video_renderers(GtkWidget *pb){ gtk_list_store_append(store,&iter); gtk_list_store_set(store,&iter,0,desc->name,1,desc->text,-1); if (current_renderer && strcmp(current_renderer,desc->name)==0) - gtk_combo_box_set_active(GTK_COMBO_BOX(combo),i); + active=i; } ms_list_free(l); - + if (active!=-1) gtk_combo_box_set_active(GTK_COMBO_BOX(combo),active); } void linphone_gtk_show_parameters(void){