[zaptel-commits] sruffell: branch 1.4 r4592 - in /branches/1.4/kernel: ./ wctc4xxp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Dec 4 17:01:48 CST 2008


Author: sruffell
Date: Thu Dec  4 17:01:48 2008
New Revision: 4592

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4592
Log:
- Ensure that the sample size is set correctly when decoding G723 packets.
- Do not use an already built channel if the source and destination formats do
  not match the formats we want.  This fixes a regression introduced by the
  new transcoder interface where a translation path from one complex codec to
  another can result in garbled audio.

Modified:
    branches/1.4/kernel/wctc4xxp/base.c
    branches/1.4/kernel/zttranscode.c

Modified: branches/1.4/kernel/wctc4xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/wctc4xxp/base.c?view=diff&rev=4592&r1=4591&r2=4592
==============================================================================
--- branches/1.4/kernel/wctc4xxp/base.c (original)
+++ branches/1.4/kernel/wctc4xxp/base.c Thu Dec  4 17:01:48 2008
@@ -1755,6 +1755,8 @@
 			   "%d/%d bytes.\n", count, G723_5K_BYTES, G723_6K_BYTES);
 			return -EINVAL;
 		}
+		cpvt->timestamp += G723_SAMPLES;
+	} else if (ZT_FORMAT_G723_1 == dtc->dstfmt) {
 		cpvt->timestamp += G723_SAMPLES;
 	} else {
 		/* Same for ulaw and alaw */

Modified: branches/1.4/kernel/zttranscode.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/zttranscode.c?view=diff&rev=4592&r1=4591&r2=4592
==============================================================================
--- branches/1.4/kernel/zttranscode.c (original)
+++ branches/1.4/kernel/zttranscode.c Thu Dec  4 17:01:48 2008
@@ -190,8 +190,17 @@
 	for (i = 0; i < tc->numchannels; i++) {
 		chan = &tc->channels[i];
 		if (!zt_tc_is_busy(chan)) {
-			zt_tc_set_busy(chan);
-			return chan;
+			if (!zt_tc_is_built(chan)) {
+				zt_tc_set_busy(chan);
+				return chan;
+			} else {
+				/* If the channel is already built, we must
+				 * make sure that it can support the formats
+				 * that we're interested in. */
+				if ((fmts->srcfmt|fmts->dstfmt) ==
+					chan->built_fmts)
+					return chan;
+			}
 		}
 	}
 	return NULL;




More information about the zaptel-commits mailing list