diff --git a/linphone/coreapi/linphonecore.c b/linphone/coreapi/linphonecore.c
index 682a5c44fe10ee16443a51a0c70b3a2aef822a37..01819f3b276b47206f6f8273774eff152576cf2a 100644
--- a/linphone/coreapi/linphonecore.c
+++ b/linphone/coreapi/linphonecore.c
@@ -643,18 +643,19 @@ const char * linphone_core_get_version(void){
 static PayloadType * payload_type_h264_packetization_mode_1=NULL;
 static PayloadType * linphone_h263_1998=NULL;
 static PayloadType * linphone_mp4v_es=NULL;
+static PayloadType * linphone_h263_old=NULL;
 #endif
 
 void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path, void * userdata)
 {
 	memset (lc, 0, sizeof (LinphoneCore));
 	lc->data=userdata;
-	
+
 	memcpy(&lc->vtable,vtable,sizeof(LinphoneCoreVTable));
 
-        gstate_initialize(lc);
-        gstate_new_state(lc, GSTATE_POWER_STARTUP, NULL);
-        
+	gstate_initialize(lc);
+	gstate_new_state(lc, GSTATE_POWER_STARTUP, NULL);
+	
 	ortp_init();
 	rtp_profile_set_payload(&av_profile,115,&payload_type_lpc1015);
 	rtp_profile_set_payload(&av_profile,110,&payload_type_speex_nb);
@@ -670,6 +671,10 @@ void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, co
 	payload_type_set_recv_fmtp(linphone_h263_1998,"CIF=1;QCIF=1");
 	rtp_profile_set_payload(&av_profile,98,linphone_h263_1998);
 
+	linphone_h263_old=payload_type_clone(&payload_type_h263);
+    payload_type_set_recv_fmtp(linphone_h263_old,"QCIF=2");
+    rtp_profile_set_payload(&av_profile,34,linphone_h263_old);
+
 	linphone_mp4v_es=payload_type_clone(&payload_type_mp4v);
 	payload_type_set_recv_fmtp(linphone_mp4v_es,"profile-level-id=3");
 	rtp_profile_set_payload(&av_profile,99,linphone_mp4v_es);
@@ -778,7 +783,9 @@ void linphone_core_get_local_ip(LinphoneCore *lc, const char *dest, char *result
 		strncpy(result,lc->sip_conf.ipv6_enabled ? "::1" : "127.0.0.1",LINPHONE_IPADDR_SIZE);
 		ms_error("Could not find default routable ip address !"); 
 	}	
+	/*
 	eXosip_masquerade_contact(NULL,0);
+	*/
 }
 
 const char *linphone_core_get_primary_contact(LinphoneCore *lc)
@@ -2050,14 +2057,22 @@ static void apply_nat_settings(LinphoneCore *lc){
 
 	if (lc->net_conf.firewall_policy==LINPHONE_POLICY_USE_NAT_ADDRESS){
 		if (tmp!=NULL){
-			if (!lc->net_conf.nat_sdp_only)
+			if (!lc->net_conf.nat_sdp_only){
+				eXosip_set_option(EXOSIP_OPT_SET_IPV4_FOR_GATEWAY,tmp);
+				/* the following does not work in all cases */
+				/*
 				eXosip_masquerade_contact(tmp,lc->sip_conf.sip_port);
+				*/
+			}
 			ms_free(tmp);
 		}
-		else 
+		else{
+			eXosip_set_option(EXOSIP_OPT_SET_IPV4_FOR_GATEWAY,NULL);
 			eXosip_masquerade_contact("",0);
+		}
 	}
 	else {
+		eXosip_set_option(EXOSIP_OPT_SET_IPV4_FOR_GATEWAY,NULL);
 		eXosip_masquerade_contact("",0);	
 	}
 }
diff --git a/linphone/coreapi/sipsetup.c b/linphone/coreapi/sipsetup.c
index 250d71eb3b13cef43c63aeb299680ca110d703c6..14c0160cf0ae7d2192ed56873455862e70bc839b 100644
--- a/linphone/coreapi/sipsetup.c
+++ b/linphone/coreapi/sipsetup.c
@@ -77,7 +77,7 @@ void sip_setup_unregister_all(void){
 	for(elem=registered_sip_setups;elem!=NULL;elem=elem->next){
 		SipSetup *ss=(SipSetup*)elem->data;
 		if (ss->initialized){
-			ss->exit();
+			if (ss->exit) ss->exit();
 			ss->initialized=FALSE;
 		}
 	}
diff --git a/linphone/mediastreamer2/acinclude.m4 b/linphone/mediastreamer2/acinclude.m4
index 2f922f31a21e66beb2bb662046125f22aeaa274d..00266d14f032cc8b66f13d0f47593b6cf1069278 100644
--- a/linphone/mediastreamer2/acinclude.m4
+++ b/linphone/mediastreamer2/acinclude.m4
@@ -96,7 +96,7 @@ AC_DEFUN([MS_CHECK_VIDEO],[
 		dnl # include "swscale.h" // private linhone swscale.h
 		dnl #endif
 		CPPFLAGS_save=$CPPFLAGS
-		CPPFLAGS="SWSCALE_CFLAGS $CPPFLAGS"
+		CPPFLAGS="$SWSCALE_CFLAGS $CPPFLAGS"
 		AC_CHECK_HEADERS(libswscale/swscale.h)
 		CPPFLAGS=$CPPFLAGS_save
 
diff --git a/linphone/mediastreamer2/build/win32native/alldescs.h b/linphone/mediastreamer2/build/win32native/alldescs.h
index 9eafe2f840604fe39707f452622aee3181ca0501..e76c612a243e46ed52355b09d7b40251d8789e20 100755
--- a/linphone/mediastreamer2/build/win32native/alldescs.h
+++ b/linphone/mediastreamer2/build/win32native/alldescs.h
@@ -21,6 +21,8 @@ extern MSFilterDesc ms_v4w_desc;
 extern MSFilterDesc ms_video_out_desc;
 extern MSFilterDesc ms_h263_enc_desc;
 extern MSFilterDesc ms_h263_dec_desc;
+extern MSFilterDesc ms_h263_old_enc_desc;
+extern MSFilterDesc ms_h263_old_dec_desc;
 extern MSFilterDesc ms_mpeg4_enc_desc;
 extern MSFilterDesc ms_mpeg4_dec_desc;
 extern MSFilterDesc ms_snow_enc_desc;
@@ -56,6 +58,8 @@ MSFilterDesc * ms_filter_descs[]={
 &ms_conf_desc,
 &ms_v4w_desc,
 &ms_video_out_desc,
+&ms_h263_old_enc_desc,
+&ms_h263_old_dec_desc,
 &ms_h263_enc_desc,
 &ms_h263_dec_desc,
 &ms_mpeg4_enc_desc,
diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac
index 654633b39dc30635a1542bbb04547c7d35e53816..ce50cbe3a78fa02ed54689ba26f6f8b0d0b72488 100644
--- a/linphone/mediastreamer2/configure.ac
+++ b/linphone/mediastreamer2/configure.ac
@@ -447,6 +447,10 @@ fi
 dnl check various things
 AC_FUNC_ALLOCA
 
+if test "x${prefix}" = "xNONE"; then
+	prefix=${ac_default_prefix}
+fi
+
 dnl define path of plugins:
 AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${prefix}/lib/mediastreamer/plugins" ,[path of plugins])
 PACKAGE_PLUGINS_DIR="${prefix}/lib/mediastreamer/plugins"
diff --git a/linphone/mediastreamer2/src/videoout.c b/linphone/mediastreamer2/src/videoout.c
index 1b018b1c67192db1a6f9888e51d7c52750efacba..8d1c572d86f9bddf8a8ff586eb6832106052a5c3 100644
--- a/linphone/mediastreamer2/src/videoout.c
+++ b/linphone/mediastreamer2/src/videoout.c
@@ -212,6 +212,8 @@ static bool_t sdl_poll_event(MSDisplay *obj, MSDisplayEvent *ev){
 
 static void sdl_display_uninit(MSDisplay *obj){
 	SDL_Overlay *lay=(SDL_Overlay*)obj->data;
+	SDL_Event event;
+	int i;
 	if (lay==NULL)
 		return;
 	if (lay!=NULL)
@@ -220,6 +222,9 @@ static void sdl_display_uninit(MSDisplay *obj){
 		SDL_FreeSurface(sdl_screen);
 		sdl_screen=NULL;
 	}
+	/*purge the event queue before leaving*/
+	for(i=0;SDL_PollEvent(&event) && i<100;++i){
+	}
 	sdl_show_window(FALSE);
 }
 
@@ -689,8 +694,10 @@ static int video_out_handle_resizing(MSFilter *f, void *data){
 				sz.width=ev.w;
 				sz.height=ev.h;
 				ms_filter_lock(f);
-				set_vsize(s,&sz);
-				s->ready=FALSE;
+				if (s->ready){
+					set_vsize(s,&sz);
+					s->ready=FALSE;
+				}
 				ms_filter_unlock(f);
 			}
 		}