[svn-commits] kpfleming: branch 1.4 r91870 - /branches/1.4/codecs/codec_zap.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Dec 7 16:30:59 CST 2007


Author: kpfleming
Date: Fri Dec  7 16:30:59 2007
New Revision: 91870

URL: http://svn.digium.com/view/asterisk?view=rev&rev=91870
Log:
even though Asterisk explicitly requests that endpoints using G.729 do *not* use Annex B (silence detection and comfort noise generation) some do anyway; the transcoder card interface does not currently work properly with CNG frames, so trim off the CNG before sending the data

Modified:
    branches/1.4/codecs/codec_zap.c

Modified: branches/1.4/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/codec_zap.c?view=diff&rev=91870&r1=91869&r2=91870
==============================================================================
--- branches/1.4/codecs/codec_zap.c (original)
+++ branches/1.4/codecs/codec_zap.c Fri Dec  7 16:30:59 2007
@@ -145,6 +145,15 @@
 	if (!hdr->srclen)
 		/* Copy at front of buffer */
 		hdr->srcoffset = 0;
+
+	/* if we get handed a G.729 frame that is not a multiple of
+	   10 bytes (10 milliseconds), then it has a CNG frame and
+	   we need to avoid sending that to the transcoder
+	*/
+	if ((f->subclass == AST_FORMAT_G729A) && ((f->datalen % 10) != 0)) {
+		f->datalen -= f->datalen % 10;
+		f->samples = f->datalen * 8;
+	}
 
 	if (hdr->srclen + f->datalen > sizeof(hdr->srcdata)) {
 		ast_log(LOG_WARNING, "Out of space for codec translation!\n");




More information about the svn-commits mailing list