[asterisk-commits] file: branch 1.2 r42402 - /branches/1.2/channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 7 21:37:07 MST 2006


Author: file
Date: Thu Sep  7 23:37:07 2006
New Revision: 42402

URL: http://svn.digium.com/view/asterisk?rev=42402&view=rev
Log:
Use ast_best_codec to set the read/write format

Modified:
    branches/1.2/channels/chan_local.c

Modified: branches/1.2/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_local.c?rev=42402&r1=42401&r2=42402&view=diff
==============================================================================
--- branches/1.2/channels/chan_local.c (original)
+++ branches/1.2/channels/chan_local.c Thu Sep  7 23:37:07 2006
@@ -515,7 +515,7 @@
 static struct ast_channel *local_new(struct local_pvt *p, int state)
 {
 	struct ast_channel *tmp, *tmp2;
-	int randnum = rand() & 0xffff;
+	int randnum = rand() & 0xffff, fmt = 0;
 
 	tmp = ast_channel_alloc(1);
 	tmp2 = ast_channel_alloc(1);
@@ -537,14 +537,15 @@
 	tmp2->type = type;
 	ast_setstate(tmp, state);
 	ast_setstate(tmp2, AST_STATE_RING);
-	tmp->writeformat = p->reqformat;
-	tmp2->writeformat = p->reqformat;
-	tmp->rawwriteformat = p->reqformat;
-	tmp2->rawwriteformat = p->reqformat;
-	tmp->readformat = p->reqformat;
-	tmp2->readformat = p->reqformat;
-	tmp->rawreadformat = p->reqformat;
-	tmp2->rawreadformat = p->reqformat;
+	fmt = ast_best_codec(p->reqformat);
+	tmp->writeformat = fmt;
+	tmp2->writeformat = fmt;
+	tmp->rawwriteformat = fmt;
+	tmp2->rawwriteformat = fmt;
+	tmp->readformat = fmt;
+	tmp2->readformat = fmt;
+	tmp->rawreadformat = fmt;
+	tmp2->rawreadformat = fmt;
 	tmp->tech_pvt = p;
 	tmp2->tech_pvt = p;
 	p->owner = tmp;



More information about the asterisk-commits mailing list