aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-08 04:37:07 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-08 04:37:07 +0000
commit3cb1e27f5d1c26e931b9311a1ec5b407c51e3885 (patch)
tree6f94ebbe4e1d5c5ffa62a3aef543b675a8b67d9c
parentf38c6d31d7a68f60ee41c9fcd4ac44a2d17ee73b (diff)
Use ast_best_codec to set the read/write format
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@42402 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_local.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index a28964167..84fd9d220 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -515,7 +515,7 @@ static struct local_pvt *local_alloc(char *data, int format)
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 @@ static struct ast_channel *local_new(struct local_pvt *p, int state)
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;