From bc66a5bb9818094258b8a9bbaf03f83cbfddbb5f Mon Sep 17 00:00:00 2001 From: aymeric Date: Fri, 3 Apr 2009 11:49:19 +0000 Subject: [PATCH] choose different value for halfduplex mode. Need more work to be configurable now. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@403 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/mediastreamer2/src/msconf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/linphone/mediastreamer2/src/msconf.c b/linphone/mediastreamer2/src/msconf.c index 6882cd901..fc85910f8 100644 --- a/linphone/mediastreamer2/src/msconf.c +++ b/linphone/mediastreamer2/src/msconf.c @@ -406,7 +406,7 @@ static void conf_sum(MSFilter *f, ConfState *s){ if (i>0) /* not for MIC */ { - if (chan->energy>5) + if (chan->energy>65) chan->count_speaking++; else chan->count_speaking=0; @@ -522,18 +522,16 @@ static void conf_dispatch(MSFilter *f, ConfState *s){ if (f->outputs[i]!=NULL){ chan=&s->channels[i]; if (s->channels[0].is_speaking>0 // if MIC is speaking - && s->channels[0].count_speaking<25 // if MIC was silence a few time ago + && s->channels[0].count_speaking<75 // if MIC was silence a few time ago && chan->count_speaking>0 // if RTP has started to talk - && chan->count_speaking<25 // if RTP was silence a few ms ago + && chan->count_speaking<75 // if RTP was silence a few ms ago && i%2==1) // false detection of MIC speaking { ms_message("false detection of MIC speaking: turned off"); - s->channels[0].is_speaking=-1; - s->channels[0].count_speaking=0; m=conf_output(s,chan, 5); } else if (s->channels[0].is_speaking<0 && i%2==1) // MIC is NOT speaking -> send silence on RTP - m=conf_output(s,chan, 5); + m=conf_output(s,chan, 32000); else m=conf_output(s,chan, 1); ms_queue_put(f->outputs[i],m);