[Asterisk-code-review] bridge_softmix: Always remove audio from mixed frame. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed May 20 10:07:51 CDT 2020


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14434 )

Change subject: bridge_softmix: Always remove audio from mixed frame.
......................................................................

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
---
M bridges/bridge_softmix.c
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit



diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 09218ce..36d82a5 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -207,9 +207,8 @@
 	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 && !sc->binaural) {
+	/* If we provided any audio then take it out while in slinear format. */
+	if (sc->have_audio && !sc->binaural) {
 		for (i = 0; i < sc->write_frame.samples; i++) {
 			ast_slinear_saturated_subtract(&sc->final_buf[i], &sc->our_buf[i]);
 		}
@@ -224,7 +223,7 @@
 		/* do not do any special write translate optimization if we had to make
 		 * a special mix for them to remove their own audio. */
 		return;
-	} else if (sc->have_audio && sc->talking && sc->binaural > 0) {
+	} else if (sc->have_audio && sc->binaural > 0) {
 		/*
 		 * Binaural audio requires special saturated substract since we have two
 		 * audio signals per channel now.

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14434
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb
Gerrit-Change-Number: 14434
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200520/d0b2dc1b/attachment.html>


More information about the asterisk-code-review mailing list