[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r338036 - /team/irroot/distrote...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 27 06:21:52 CDT 2011


Author: irroot
Date: Tue Sep 27 06:21:48 2011
New Revision: 338036

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338036
Log:
Make sure bridge is real chan and fix dst/src mixup in copy formats

Modified:
    team/irroot/distrotech-customers-10/channels/chan_local.c

Modified: team/irroot/distrotech-customers-10/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/channels/chan_local.c?view=diff&rev=338036&r1=338035&r2=338036
==============================================================================
--- team/irroot/distrotech-customers-10/channels/chan_local.c (original)
+++ team/irroot/distrotech-customers-10/channels/chan_local.c Tue Sep 27 06:21:48 2011
@@ -609,18 +609,19 @@
 		ao2_unlock(p);
 		bridge = ast_bridged_channel(ast);
 		ao2_lock(p);
-		if (bridge && !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
-			while (lockcheck && p->chan && ast_channel_trylock(p->chan)) {
+		if (p->chan && bridge && (bridge != p->chan) && 
+		    !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
+			while (lockcheck && ast_channel_trylock(p->chan)) {
 				lockcheck--;
 				ao2_unlock(p);
 				usleep(1000);
 				ao2_lock(p);
 			}
 			if (lockcheck) {
-				ast_format_cap_copy(bridge->nativeformats, ast->nativeformats);
+				ast_format_cap_copy(ast->nativeformats, bridge->nativeformats);
 				ast_set_read_format(ast, &ast->readformat);
 				ast_set_write_format(ast, &ast->writeformat);
-				ast_format_cap_copy(bridge->nativeformats, p->chan->nativeformats);
+				ast_format_cap_copy(p->chan->nativeformats, bridge->nativeformats);
 				ast_set_read_format(p->chan, &p->chan->readformat);
 				ast_set_write_format(p->chan, &p->chan->writeformat);
 				ast_channel_unlock(p->chan);




More information about the asterisk-commits mailing list