[svn-commits] sruffell: branch 1.6.2 r293969 - in /branches/1.6.2: ./ codecs/codec_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 4 19:06:06 CDT 2010


Author: sruffell
Date: Thu Nov  4 19:06:02 2010
New Revision: 293969

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=293969
Log:
Merged revisions 293968 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r293968 | sruffell | 2010-11-04 19:02:53 -0500 (Thu, 04 Nov 2010) | 17 lines
  
  codecs/codec_dahdi: Prevent "choppy" audio when receiving unexpected frame sizes.
  
  dahdi-linux 2.4.0 (specifically commit 9034) added the capability for
  the wctc4xxp to return more than a single packet of data in response to
  a read.  However, when decoding packets, codec_dahdi was still assuming
  that the default number of samples was in each read.
  
  In other words, each packet your provider sent you, regardless of size,
  would result in 20 ms of decoded data (30 ms if decoding G723). If your
  provider was sending 60 ms packets then codec_dahdi would end up
  stripping 40 ms of data from each transcoded frame resulting in "choppy"
  audio.
  
  This would only affect systems where G729 packets are arriving in sizes
  greater than 20ms or G723 packets arriving in sizes greater than 30ms.
  
  DAHDI-744.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/codecs/codec_dahdi.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: branches/1.6.2/codecs/codec_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/codecs/codec_dahdi.c?view=diff&rev=293969&r1=293968&r2=293969
==============================================================================
--- branches/1.6.2/codecs/codec_dahdi.c (original)
+++ branches/1.6.2/codecs/codec_dahdi.c Thu Nov  4 19:06:02 2010
@@ -92,10 +92,10 @@
 };
 
 /* Only used by a decoder */
-static int ulawtolin(struct ast_trans_pvt *pvt)
-{
-	struct codec_dahdi_pvt *dahdip = pvt->pvt;
-	int i = dahdip->required_samples;
+static int ulawtolin(struct ast_trans_pvt *pvt, int samples)
+{
+	struct codec_dahdi_pvt *dahdip = pvt->pvt;
+	int i = samples;
 	uint8_t *src = &dahdip->ulaw_buffer[0];
 	int16_t *dst = pvt->outbuf.i16 + pvt->datalen;
 
@@ -334,7 +334,7 @@
 		}
 	} else {
 		if (dahdip->softslin) {
-			ulawtolin(pvt);
+			ulawtolin(pvt, res);
 			pvt->f.datalen = res * 2;
 		} else {
 			pvt->f.datalen = res;
@@ -346,7 +346,7 @@
 		pvt->f.offset = AST_FRIENDLY_OFFSET;
 		pvt->f.src = pvt->t->name;
 		pvt->f.data.ptr = pvt->outbuf.c;
-		pvt->f.samples = dahdip->required_samples;
+		pvt->f.samples = res;
 		ast_set_flag(&pvt->f, AST_FRFLAG_FROM_TRANSLATOR);
 		pvt->samples = 0;
 




More information about the svn-commits mailing list