summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-03-20 17:27:24 -0400
committerSean Bright <sean.bright@gmail.com>2017-03-20 15:31:28 -0600
commitaac3c94ca44e6b49134ad896cf8c5e523bc52a48 (patch)
tree0c404c8589823e66704e340577db3d2e33c3b549 /bridges
parent8c529c4f927ed1ba579fac41aa38c713d76d86d3 (diff)
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
Diffstat (limited to 'bridges')
-rw-r--r--bridges/bridge_softmix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 1c35a2316..200878fd6 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -306,7 +306,8 @@ static void softmix_process_write_audio(struct softmix_translate_helper *trans_h
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;