]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
improve echo calibration
[linphone] / coreapi / linphonecore.c
index 5ba0fbf700d78965838b0e1070a0b642fad3ec44..d9d199c3f95102cf8e43d4693e4dd71fb95a24dd 100644 (file)
@@ -2054,9 +2054,11 @@ void linphone_core_iterate(LinphoneCore *lc){
                                lc->ecc->cb(lc,ecs,lc->ecc->delay,lc->ecc->cb_data);
                        if (ecs==LinphoneEcCalibratorDone){
                                int len=lp_config_get_int(lc->config,"sound","ec_tail_len",0);
-                               lp_config_set_int(lc->config, "sound", "ec_delay",MAX(lc->ecc->delay-(len/2),0));
+                               int margin=len/2;
+                               
+                               lp_config_set_int(lc->config, "sound", "ec_delay",MAX(lc->ecc->delay-margin,0));
                        } else if (ecs == LinphoneEcCalibratorFailed) {
-                               lp_config_set_int(lc->config, "sound", "ec_delay", LP_CONFIG_DEFAULT_INT(lc->config, "ec_delay", 250));
+                               lp_config_set_int(lc->config, "sound", "ec_delay", -1);/*use default value from soundcard*/
                        } else if (ecs == LinphoneEcCalibratorDoneNoEcho) {
                                linphone_core_enable_echo_cancellation(lc, FALSE);
                        }