[svn-commits] sruffell: branch linux/sruffell/dahdi-linux-transcoder r5435 - in /linux/team...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 4 15:12:27 CST 2008


Author: sruffell
Date: Thu Dec  4 15:12:27 2008
New Revision: 5435

URL: http://svn.digium.com/view/dahdi?view=rev&rev=5435
Log:
Merged revisions 5433-5434 via svnmerge from 
https://origsvn.digium.com/svn/dahdi/linux/trunk

........
r5433 | sruffell | 2008-12-04 12:55:25 -0800 (Thu, 04 Dec 2008) | 5 lines

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.

........
r5434 | sruffell | 2008-12-04 12:57:28 -0800 (Thu, 04 Dec 2008) | 4 lines

Fix an erroneous warning and ensure that the sample size is set correctly when
decoding G723 packets.
Issue: DAHDI-198

........

Modified:
    linux/team/sruffell/dahdi-linux-transcoder/   (props changed)
    linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/dahdi_transcode.c
    linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c

Propchange: linux/team/sruffell/dahdi-linux-transcoder/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Dec  4 15:12:27 2008
@@ -1,1 +1,1 @@
-/linux/trunk:1-5420
+/linux/trunk:1-5434

Modified: linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/dahdi_transcode.c
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/dahdi_transcode.c?view=diff&rev=5435&r1=5434&r2=5435
==============================================================================
--- linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/dahdi_transcode.c (original)
+++ linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/dahdi_transcode.c Thu Dec  4 15:12:27 2008
@@ -179,8 +179,8 @@
 
 /* Find a free channel on the transcoder and mark it busy. */
 static inline struct dahdi_transcoder_channel *
-get_free_channel(struct dahdi_transcoder *tc)
-
+get_free_channel(struct dahdi_transcoder *tc,
+	const struct dahdi_transcoder_formats *fmts)
 {
 	struct dahdi_transcoder_channel *chan;
 	int i;
@@ -190,8 +190,18 @@
 	for (i = 0; i < tc->numchannels; i++) {
 		chan = &tc->channels[i];
 		if (!dahdi_tc_is_busy(chan)) {
-			dahdi_tc_set_busy(chan);
-			return chan;
+			if (!dahdi_tc_is_built(chan)) {
+				dahdi_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) {
+					dahdi_tc_set_busy(chan);
+					return chan;
+				}
+			}
 		}
 	}
 	return NULL;
@@ -216,7 +226,7 @@
 			/* We found a transcoder that can handle our formats.
 			 * Now look for an available channel. */
 			match = 1; 
-			if ((chan = get_free_channel(tc))) {
+			if ((chan = get_free_channel(tc, fmts))) {
 				/* transcoder tc has a free channel.  In order
 				 * to spread the load among available
 				 * transcoders (when there are more than one

Modified: linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c?view=diff&rev=5435&r1=5434&r2=5435
==============================================================================
--- linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c Thu Dec  4 15:12:27 2008
@@ -1651,6 +1651,9 @@
 	/* Mark this channel as built */
 	dahdi_tc_set_built(dtc);
 	dtc->built_fmts = dtc->dstfmt | dtc->srcfmt;
+	DTE_DEBUG(DTE_DEBUG_CHANNEL_SETUP,
+	  "Channel %p has dstfmt=%x and srcfmt=%x\n", dtc, dtc->dstfmt,
+	  dtc->srcfmt);
 	/* Mark the channel complement (other half of encoder/decoder pair) as
 	 * built */
 	res = wctc4xxp_mark_channel_complement_built(wc, dtc);
@@ -1889,6 +1892,8 @@
 			return -EINVAL;
 		}
 		cpvt->timestamp += G723_SAMPLES;
+	} else if (DAHDI_FORMAT_G723_1 == dtc->dstfmt) {
+		cpvt->timestamp = G723_SAMPLES;
 	} else {
 		/* Same for ulaw and alaw */
 		cpvt->timestamp += G729_SAMPLES;
@@ -1955,7 +1960,6 @@
 			list_del_init(&pos->node);
 			pos->flags &= ~(__WAIT_FOR_RESPONSE);
 			pos->response = cmd;
-			WARN_ON(pos->response);
 			WARN_ON(!(pos->flags & TX_COMPLETE));
 			WARN_ON(!(pos->flags & TX_COMPLETE));
 			complete(&pos->complete);




More information about the svn-commits mailing list