[asterisk-commits] rmudgett: trunk r419206 - /trunk/codecs/codec_speex.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 22 12:10:42 CDT 2014


Author: rmudgett
Date: Tue Jul 22 12:10:36 2014
New Revision: 419206

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=419206
Log:
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/

Modified:
    trunk/codecs/codec_speex.c

Modified: trunk/codecs/codec_speex.c
URL: http://svnview.digium.com/svn/asterisk/trunk/codecs/codec_speex.c?view=diff&rev=419206&r1=419205&r2=419206
==============================================================================
--- trunk/codecs/codec_speex.c (original)
+++ trunk/codecs/codec_speex.c Tue Jul 22 12:10:36 2014
@@ -306,16 +306,21 @@
 		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);
 		}
 	}
 




More information about the asterisk-commits mailing list