diff --git a/linphone/mediastreamer2/src/winsnd2.c b/linphone/mediastreamer2/src/winsnd2.c
index 8d5de36d4020d37ed09ce1bb5047a734c2b681ab..f8b6f24813d430b101408ad327d62ef61c51de3d 100755
--- a/linphone/mediastreamer2/src/winsnd2.c
+++ b/linphone/mediastreamer2/src/winsnd2.c
@@ -901,7 +901,8 @@ static void winsndcard_unload(MSSndCardManager *m){
 
 static void winsndcard_detect(MSSndCardManager *m){
 	_winsndcard_detect(m);
-	ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL);
+	if (poller_thread==NULL)
+		ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL);
 }
 
 typedef struct WinSnd{
@@ -1105,6 +1106,12 @@ static void winsnd_read_preprocess(MSFilter *f){
 			return ;
 		}
 	}
+#ifndef _TRUE_TIME
+	ms_mutex_lock(&f->ticker->lock);
+	ms_ticker_set_time_func(f->ticker,winsnd_get_cur_time,d);
+	ms_mutex_unlock(&f->ticker->lock);
+#endif
+
 	bsize=WINSND_NSAMPLES*d->wfx.nAvgBytesPerSec/8000;
 	ms_debug("Using input buffers of %i bytes",bsize);
 	for(i=0;i<WINSND_NBUFS;++i){
@@ -1115,11 +1122,13 @@ static void winsnd_read_preprocess(MSFilter *f){
 	mr=waveInStart(d->indev);
 	if (mr != MMSYSERR_NOERROR){
 		ms_error("waveInStart() error");
-		return ;
-	}
 #ifndef _TRUE_TIME
-	ms_ticker_set_time_func(f->ticker,winsnd_get_cur_time,d);
+		ms_mutex_lock(&f->ticker->lock);
+		ms_ticker_set_time_func(f->ticker,NULL,NULL);
+		ms_mutex_unlock(&f->ticker->lock);
 #endif
+		return ;
+	}
 }
 
 static void winsnd_read_postprocess(MSFilter *f){
@@ -1127,7 +1136,9 @@ static void winsnd_read_postprocess(MSFilter *f){
 	MMRESULT mr;
 	int i;
 #ifndef _TRUE_TIME
+	ms_mutex_lock(&f->ticker->lock);
 	ms_ticker_set_time_func(f->ticker,NULL,NULL);
+	ms_mutex_unlock(&f->ticker->lock);
 #endif
 	d->running=FALSE;
 	mr=waveInStop(d->indev);
diff --git a/linphone/mediastreamer2/src/winsndds.cpp b/linphone/mediastreamer2/src/winsndds.cpp
index c0cb5b83aa9765a15d0d322926cbdfbd3937b54f..fd20609a3b8a7b38ba70a55d143b277ed8167bc5 100644
--- a/linphone/mediastreamer2/src/winsndds.cpp
+++ b/linphone/mediastreamer2/src/winsndds.cpp
@@ -1147,7 +1147,8 @@ static void winsnddscard_unload(MSSndCardManager *m){
 
 static void winsnddscard_detect(MSSndCardManager *m){
 	_winsnddscard_detect(m);
-	ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL);
+	if (poller_thread==NULL)
+		ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL);
 }
 
 typedef struct WinSndDs{
@@ -1350,7 +1351,9 @@ static void winsndds_read_preprocess(MSFilter *f){
 
 	hr = IDirectSoundCaptureBuffer_Start( d->lpDirectSoundInputBuffer, DSCBSTART_LOOPING );
 
+	ms_mutex_lock(&f->ticker->lock);
 	ms_ticker_set_time_func(f->ticker,winsndds_get_cur_time,d);
+	ms_mutex_unlock(&f->ticker->lock);
 
 	d->thread_running=TRUE;
 	ms_thread_create(&d->thread,NULL,winsndds_read_thread,d);
@@ -1370,7 +1373,9 @@ static void winsndds_read_postprocess(MSFilter *f){
 	ms_mutex_unlock(&d->thread_lock);
 	ms_thread_join(d->thread,NULL);
 
+	ms_mutex_lock(&f->ticker->lock);
 	ms_ticker_set_time_func(f->ticker,NULL,NULL);
+	ms_mutex_unlock(&f->ticker->lock);
 
 	if( d->lpDirectSoundInputBuffer )
 	{
@@ -1519,7 +1524,9 @@ static void winsndds_write_preprocess(MSFilter *f){
 
 		hr = IDirectSoundCaptureBuffer_Start( d_capture_filter->lpDirectSoundInputBuffer, DSCBSTART_LOOPING );
 
+		ms_mutex_lock(&f->ticker->lock);
 		ms_ticker_set_time_func(f_capture_filter->ticker,winsndds_get_cur_time,d_capture_filter);
+		ms_mutex_unlock(&f->ticker->lock);
 
 		d_capture_filter->thread_running=TRUE;
 		ms_thread_create(&d_capture_filter->thread,NULL,winsndds_read_thread,d_capture_filter);