summaryrefslogtreecommitdiff
path: root/codecs
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-07-22 17:10:36 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-07-22 17:10:36 +0000
commit197f06bed16cf1babf18a1c611b99ff98aa559e4 (patch)
tree56c7ced04d2e0105bed5997668e2c6951336a501 /codecs
parentbb87796f67f8cef493a89e8b685e895142bfdce4 (diff)
codec_speex: Fix trashing normal static frame for AST_FRAME_CNG.
Made use a local static frame to generate the AST_FRAME_CNG frame when silence starts. I don't think the handling of the AST_FRAME_CNG has ever really worked because there doesn't seem to be any consumers of it. Review: https://reviewboard.asterisk.org/r/3813/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs')
-rw-r--r--codecs/codec_speex.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/codecs/codec_speex.c b/codecs/codec_speex.c
index 8c2c3f395..84ce07a5d 100644
--- a/codecs/codec_speex.c
+++ b/codecs/codec_speex.c
@@ -306,16 +306,21 @@ static struct ast_frame *lintospeex_frameout(struct ast_trans_pvt *pvt)
if (tmp->silent_state) {
return NULL;
} else {
+ struct ast_frame frm = {
+ .frametype = AST_FRAME_CNG,
+ .src = pvt->t->name,
+ };
+
+ /*
+ * XXX I don't think the AST_FRAME_CNG code has ever
+ * really worked for speex. There doesn't seem to be
+ * any consumers of the frame type. Everyone that
+ * references the type seems to pass the frame on.
+ */
tmp->silent_state = 1;
- speex_bits_reset(&tmp->bits);
-/* BUGBUG need to setup a new static frame to prevent destroying the translators normal static frame. */
- ao2_cleanup(pvt->f.subclass.format);
- memset(&pvt->f, 0, sizeof(pvt->f));
- pvt->f.frametype = AST_FRAME_CNG;
- pvt->f.samples = samples;
/* XXX what now ? format etc... */
-/* BUGBUG should return ast_frisolate(setup local static frame) here */
+ return ast_frisolate(&frm);
}
}