[Asterisk-cvs] asterisk channel.c,1.137,1.138

markster at lists.digium.com markster at lists.digium.com
Fri Sep 3 21:03:39 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv22641

Modified Files:
	channel.c 
Log Message:
If nativeformats changes, recalculate formats (bug #2224)


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- channel.c	2 Sep 2004 13:48:11 -0000	1.137
+++ channel.c	4 Sep 2004 01:06:42 -0000	1.138
@@ -2506,6 +2506,8 @@
 	int res=0;
 	int nativefailed=0;
 	int firstpass;
+	int o0nativeformats;
+	int o1nativeformats;
 	struct timeval start_time,precise_now;
 	long elapsed_ms=0, time_left_ms=0;
 	int playit=0, playitagain=1, first_time=1;
@@ -2550,7 +2552,8 @@
 			"Uniqueid1: %s\r\n"
 			"Uniqueid2: %s\r\n",
 			c0->name, c1->name, c0->uniqueid, c1->uniqueid);
-
+	o1nativeformats = c1->nativeformats;
+	o0nativeformats = c0->nativeformats;
 	for (/* ever */;;) {
 		/* timestamp */
 		if (config->timelimit) {
@@ -2624,7 +2627,7 @@
 			if (res != -3) nativefailed++;
 		}
 	
-		if (((c0->writeformat != c1->readformat) || (c0->readformat != c1->writeformat)) &&
+		if (((c0->writeformat != c1->readformat) || (c0->readformat != c1->writeformat) || (c0->nativeformats != o0nativeformats) || (c1->nativeformats != o1nativeformats)) &&
 			!(c0->generator || c1->generator))  {
 			if (ast_channel_make_compatible(c0, c1)) {
 				ast_log(LOG_WARNING, "Can't make %s and %s compatible\n", c0->name, c1->name);
@@ -2636,6 +2639,8 @@
 					c0->name, c1->name, c0->uniqueid, c1->uniqueid);
 				return -1;
 			}
+			o0nativeformats = c0->nativeformats;
+			o1nativeformats = c1->nativeformats;
 		}
 		who = ast_waitfor_n(cs, 2, &to);
 		if (!who) {




More information about the svn-commits mailing list