From 604a0f271f5b1d37ec88ad94dd7ced3536c80c70 Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Fri, 17 Sep 2010 10:14:19 +0200
Subject: [PATCH] fix some bugs

---
 console/linphonec.c       | 28 +++++++++++++++-------------
 coreapi/sal_eXosip2.c     | 10 ++++++++++
 coreapi/sal_eXosip2_sdp.c | 15 ++++++++-------
 po/POTFILES.in            |  1 -
 4 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/console/linphonec.c b/console/linphonec.c
index 7fcc0aa499..6985287d67 100644
--- a/console/linphonec.c
+++ b/console/linphonec.c
@@ -853,16 +853,16 @@ usage: linphonec [-c file] [-s sipaddr] [-a] [-V] [-d level ] [-l logfile]\n\
 #ifdef HAVE_X11_XLIB_H
 static void sdl_x11_apply_video_params(){
 	static SDL_SysWMinfo info;
-	static bool_t wminfo_ready=FALSE;
+	bool_t wminfo_ready=FALSE;
 	
-	if ( !wminfo_ready){
-		SDL_VERSION(&info.version);
-		if ( SDL_GetWMInfo(&info) ) {
-			if ( info.subsystem == SDL_SYSWM_X11 ) {
-				wminfo_ready=TRUE;
-			}
+	
+	SDL_VERSION(&info.version);
+	if ( SDL_GetWMInfo(&info) ) {
+		if ( info.subsystem == SDL_SYSWM_X11 ) {
+			wminfo_ready=TRUE;
 		}
 	}
+	
 	if ( !wminfo_ready) return;
 	
 	{
@@ -895,15 +895,17 @@ static void sdl_x11_apply_video_params(){
 
 
 static void lpc_apply_video_params(){
-	if (lpc_video_params.refresh){
-		unsigned long wid=linphone_core_get_native_video_window_id (linphonec);
-		if (wid!=0){
-			lpc_video_params.refresh=FALSE;
+	static unsigned long prev_wid=0;
+
+	unsigned long wid=linphone_core_get_native_video_window_id (linphonec);
+
+	if (wid!=0 && (lpc_video_params.refresh || prev_wid!=wid)){
+		lpc_video_params.refresh=FALSE;
 #ifdef HAVE_X11_XLIB_H
-			sdl_x11_apply_video_params();
+		sdl_x11_apply_video_params();
 #endif
-		}
 	}
+	prev_wid=wid;
 }
 
 #endif
diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c
index 25c79e5828..749bfce6b6 100644
--- a/coreapi/sal_eXosip2.c
+++ b/coreapi/sal_eXosip2.c
@@ -1124,8 +1124,18 @@ static void process_media_control_xml(Sal *sal, eXosip_event_t *ev){
 			eXosip_call_build_answer(ev->tid,200,&ans);
 			if (ans)
 				eXosip_call_send_answer(ev->tid,200,ans);
+			return;
 		}
 	}
+	/*in all other cases we must say it is not implemented.*/
+	{
+		osip_message_t *ans=NULL;
+		eXosip_lock();
+		eXosip_call_build_answer(ev->tid,501,&ans);
+		if (ans)
+			eXosip_call_send_answer(ev->tid,501,ans);
+		eXosip_unlock();
+	}
 }
 
 static void process_dtmf_relay(Sal *sal, eXosip_event_t *ev){
diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c
index 7d63148afc..a9f098ed24 100644
--- a/coreapi/sal_eXosip2_sdp.c
+++ b/coreapi/sal_eXosip2_sdp.c
@@ -323,13 +323,14 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){
 			payload_type_set_number(pt,ptn);
 			/* get the rtpmap associated to this codec, if any */
 			rtpmap=sdp_message_a_attr_value_get_with_pt(msg, i,ptn,"rtpmap");
-			payload_type_fill_from_rtpmap(pt,rtpmap);
-			/* get the fmtp, if any */
-			fmtp=sdp_message_a_attr_value_get_with_pt(msg, i, ptn,"fmtp");
-			payload_type_set_send_fmtp(pt,fmtp);
-			stream->payloads=ms_list_append(stream->payloads,pt);
-			ms_message("Found payload %s/%i fmtp=%s",pt->mime_type,pt->clock_rate,
-			    pt->send_fmtp ? pt->send_fmtp : "");
+			if (payload_type_fill_from_rtpmap(pt,rtpmap)==0){
+				/* get the fmtp, if any */
+				fmtp=sdp_message_a_attr_value_get_with_pt(msg, i, ptn,"fmtp");
+				payload_type_set_send_fmtp(pt,fmtp);
+				stream->payloads=ms_list_append(stream->payloads,pt);
+				ms_message("Found payload %s/%i fmtp=%s",pt->mime_type,pt->clock_rate,
+					pt->send_fmtp ? pt->send_fmtp : "");
+			}
 		}
 	}
 	desc->nstreams=i;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1e699aa8a8..704f413864 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,7 +20,6 @@ gtk/call_logs.ui
 gtk/main.ui
 gtk/sip_account.ui
 gtk/chatroom.ui
-gtk/incoming_call.ui
 gtk/parameters.ui
 gtk/buddylookup.ui
 gtk/waiting.ui
-- 
GitLab