From f2c5d3a143f0ed304bd441723bfe6cf5fe26753f Mon Sep 17 00:00:00 2001 From: smorlat Date: Thu, 17 Sep 2009 15:08:24 +0000 Subject: [PATCH] fix crash when echo limiter is disabled. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@663 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/coreapi/linphonecore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/linphone/coreapi/linphonecore.c b/linphone/coreapi/linphonecore.c index 2fcb0862a..b0f4a16f5 100644 --- a/linphone/coreapi/linphonecore.c +++ b/linphone/coreapi/linphonecore.c @@ -1561,12 +1561,14 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ static void post_configure_audio_streams(LinphoneCore *lc){ AudioStream *st=lc->audiostream; - if (st->volrecv && st->volsend){ + float gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); + if (gain!=-1) + audio_stream_set_mic_gain(st,gain); + if (linphone_core_echo_limiter_enabled(lc)){ float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); float thres=lp_config_get_float(lc->config,"sound","el_thres",-1); float force=lp_config_get_float(lc->config,"sound","el_force",-1); int sustain=lp_config_get_int(lc->config,"sound","el_sustain",-1); - float gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); MSFilter *f=NULL; if (st->el_type==ELControlMic){ f=st->volsend; @@ -1586,8 +1588,7 @@ static void post_configure_audio_streams(LinphoneCore *lc){ ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force); if (sustain!=-1) ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); - if (gain!=-1) - audio_stream_set_mic_gain(st,gain); + } parametrize_equalizer(lc,st); if (lc->vtable.dtmf_received!=NULL){