[asterisk-commits] qwell: branch 1.4 r65877 - in /branches/1.4: codecs/ include/asterisk/ main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 24 08:14:02 MST 2007


Author: qwell
Date: Thu May 24 10:14:02 2007
New Revision: 65877

URL: http://svn.digium.com/view/asterisk?view=rev&rev=65877
Log:
Fix handling of zero-length frames when a codec is capable of native PLC.

Issue 9183, patch by Mihai.

Modified:
    branches/1.4/codecs/codec_ilbc.c
    branches/1.4/codecs/codec_speex.c
    branches/1.4/include/asterisk/translate.h
    branches/1.4/main/translate.c

Modified: branches/1.4/codecs/codec_ilbc.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/codec_ilbc.c?view=diff&rev=65877&r1=65876&r2=65877
==============================================================================
--- branches/1.4/codecs/codec_ilbc.c (original)
+++ branches/1.4/codecs/codec_ilbc.c Thu May 24 10:14:02 2007
@@ -203,6 +203,7 @@
 	.sample = ilbctolin_sample,
 	.desc_size = sizeof(struct ilbc_coder_pvt),
 	.buf_size = BUFFER_SAMPLES * 2,
+	.native_plc = 1,
 };
 
 static struct ast_translator lintoilbc = {

Modified: branches/1.4/codecs/codec_speex.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/codec_speex.c?view=diff&rev=65877&r1=65876&r2=65877
==============================================================================
--- branches/1.4/codecs/codec_speex.c (original)
+++ branches/1.4/codecs/codec_speex.c Thu May 24 10:14:02 2007
@@ -355,6 +355,7 @@
 	.desc_size = sizeof(struct speex_coder_pvt),
 	.buffer_samples = BUFFER_SAMPLES,
 	.buf_size = BUFFER_SAMPLES * 2,
+	.native_plc = 1,
 };
 
 static struct ast_translator lintospeex = {

Modified: branches/1.4/include/asterisk/translate.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/translate.h?view=diff&rev=65877&r1=65876&r2=65877
==============================================================================
--- branches/1.4/include/asterisk/translate.h (original)
+++ branches/1.4/include/asterisk/translate.h Thu May 24 10:14:02 2007
@@ -104,6 +104,7 @@
 	int desc_size;			/*!< size of private descriptor in pvt->pvt, if any */
 	int plc_samples;		/*!< set to the plc block size if used, 0 otherwise */
 	int useplc;			/*!< current status of plc, changed at runtime */
+	int native_plc;			/*!< true if the translator can do native plc */
 
 	struct ast_module *module;	/* opaque reference to the parent module */
 

Modified: branches/1.4/main/translate.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/translate.c?view=diff&rev=65877&r1=65876&r2=65877
==============================================================================
--- branches/1.4/main/translate.c (original)
+++ branches/1.4/main/translate.c Thu May 24 10:14:02 2007
@@ -174,7 +174,9 @@
 				pvt->samples += l;
 				pvt->datalen = pvt->samples * 2;	/* SLIN has 2bytes for 1sample */
 			}
-			return 0;
+			/* We don't want generic PLC. If the codec has native PLC, then do that */
+			if (!pvt->t->native_plc)
+				return 0;
 		}
 		if (pvt->samples + f->samples > pvt->t->buffer_samples) {
 			ast_log(LOG_WARNING, "Out of buffer space\n");



More information about the asterisk-commits mailing list