From 58be7a874b541e4dfbe87ed1f8eeb68c129ee09c Mon Sep 17 00:00:00 2001 From: markster Date: Sat, 4 Sep 2004 01:06:42 +0000 Subject: If nativeformats changes, recalculate formats (bug #2224) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3722 f38db490-d61c-443f-a65b-d21fe96a405b --- channel.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/channel.c b/channel.c index dd5a80009..5c5d8e6d2 100755 --- a/channel.c +++ b/channel.c @@ -2506,6 +2506,8 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as 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 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as "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 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as 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 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as 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) { -- cgit v1.2.3