[asterisk-commits] sruffell: branch sruffell/asterisk-1.4-transcoder r156684 - /team/sruffell/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 13 14:08:30 CST 2008


Author: sruffell
Date: Thu Nov 13 14:08:30 2008
New Revision: 156684

URL: http://svn.digium.com/view/asterisk?view=rev&rev=156684
Log:
In order to take advantage of the Generic Packet Loss Concealment algorithm,
ensure codec_dahdi only transcodes between SLIN and the complex formats
(g723/g729).

Modified:
    team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c

Modified: team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c?view=diff&rev=156684&r1=156683&r2=156684
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c Thu Nov 13 14:08:30 2008
@@ -402,6 +402,7 @@
 	zt->t.sample = fakesrc_sample;
 	zt->t.useplc = global_useplc;
 	zt->t.buf_size = BUFFER_SAMPLES * 2;
+	zt->t.plc_samples = 160;
 	zt->t.desc_size = sizeof(struct pvt);
 	if ((res = ast_register_translator(&zt->t))) {
 		free(zt);
@@ -518,12 +519,16 @@
 		/* Complex codecs need to support signed linear.  If the
 		 * hardware transcoder does not natively support signed linear
 		 * format, we will emulate it in software directly in this
-		 * module. */
+		 * module. Also, do not allow direct ulaw/alaw to complex
+		 * codec translation, since that will prevent the generic PLC
+		 * functions from working. */
 		if (info.dstfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
 			info.dstfmts |= AST_FORMAT_SLINEAR;
+			info.dstfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
 		}
 		if (info.srcfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
 			info.srcfmts |= AST_FORMAT_SLINEAR;
+			info.srcfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
 		}
 
 		build_translators(&map, info.dstfmts, info.srcfmts);




More information about the asterisk-commits mailing list