[Asterisk-code-review] bridge softmix: Ignore non-voice frames from translator (asterisk[14])

Joshua Colp asteriskteam at digium.com
Tue Mar 21 17:24:33 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5263 )

Change subject: bridge_softmix: Ignore non-voice frames from translator
......................................................................


bridge_softmix: Ignore non-voice frames from translator

Some codecs - codec_speex specifically - take voice frames and return
other types of frames, like CNG. If we subsequently treat those as
voice frames, we'll run into trouble when destroying the frame because
of the requirement that each voice frame have an associated format.

ASTERISK-26880 #close
Reported by: Kirsty Tyerman

Change-Id: I43f8450c48fb276ad8b99db8512be82949c1ca7c
---
M bridges/bridge_softmix.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 1c35a23..200878f 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -306,7 +306,8 @@
 		if (entry->trans_pvt && !entry->out_frame) {
 			entry->out_frame = ast_translate(entry->trans_pvt, &sc->write_frame, 0);
 		}
-		if (entry->out_frame && (entry->out_frame->datalen < MAX_DATALEN)) {
+		if (entry->out_frame && entry->out_frame->frametype == AST_FRAME_VOICE
+				&& entry->out_frame->datalen < MAX_DATALEN) {
 			ao2_replace(sc->write_frame.subclass.format, entry->out_frame->subclass.format);
 			memcpy(sc->final_buf, entry->out_frame->data.ptr, entry->out_frame->datalen);
 			sc->write_frame.datalen = entry->out_frame->datalen;

-- 
To view, visit https://gerrit.asterisk.org/5263
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I43f8450c48fb276ad8b99db8512be82949c1ca7c
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list