From: Joshua C. Colp Date: Tue, 19 May 2020 09:18:58 +0000 (-0300) Subject: bridge_softmix: Always remove audio from mixed frame. X-Git-Tag: 13.34.0-rc1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17a878dd9945e1b395d5d93b2ad88303713e44cc;p=thirdparty%2Fasterisk.git bridge_softmix: Always remove audio from mixed frame. When receiving audio from a channel we determine if it is talking or silence based on a threshold value. If this threshold is met we always mix the audio into the conference bridge. If this threshold is not met we also mix the audio into the conference bridge UNLESS the drop silence option is enabled. The code that removed the audio from the mixed frame assumed that it was always not present if it did not meet the threshold to be considered talking. This is incorrect. If it has been stated that the audio was mixed into the mixed frame then it has been mixed into the mixed frame. By not removing audio that was considered non-talking it was possible for a channel to receive a slight echo of audio of itself at times. This change ensures that the audio is always removed from the mixed frame going back to the channel so it no longer receives the slight echo. ASTERISK-28898 Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb --- diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c index ac4e357261..65a08b512b 100644 --- a/bridges/bridge_softmix.c +++ b/bridges/bridge_softmix.c @@ -282,9 +282,8 @@ static void softmix_process_write_audio(struct softmix_translate_helper *trans_h struct softmix_translate_helper_entry *entry = NULL; int i; - /* If we provided audio that was not determined to be silence, - * then take it out while in slinear format. */ - if (sc->have_audio && sc->talking) { + /* If we provided any audio then take it out while in slinear format. */ + if (sc->have_audio) { for (i = 0; i < sc->write_frame.samples; i++) { ast_slinear_saturated_subtract(&sc->final_buf[i], &sc->our_buf[i]); }