[asterisk-commits] irroot: branch irroot/t38gateway-trunk r320944 - in /team/irroot/t38gateway-t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 26 04:31:40 CDT 2011


Author: irroot
Date: Thu May 26 04:31:28 2011
New Revision: 320944

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320944
Log:
Merge codec fixup lock sanity

Modified:
    team/irroot/t38gateway-trunk/   (props changed)
    team/irroot/t38gateway-trunk/cel/cel_odbc.c   (props changed)
    team/irroot/t38gateway-trunk/channels/chan_local.c
    team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/t38gateway-trunk/sounds/Makefile   (props changed)

Propchange: team/irroot/t38gateway-trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 26 04:31:28 2011
@@ -1,1 +1,2 @@
 /team/irroot/distrotech-customers-1.8:319062
+/team/irroot/distrotech-customers-trunk:320771

Propchange: team/irroot/t38gateway-trunk/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 26 04:31:28 2011
@@ -1,2 +1,3 @@
 /be/branches/C.3/cel/cel_adaptive_odbc.c:256426
 /team/irroot/distrotech-customers-1.8/cel/cel_odbc.c:319062
+/team/irroot/distrotech-customers-trunk/cel/cel_odbc.c:320771

Modified: team/irroot/t38gateway-trunk/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/channels/chan_local.c?view=diff&rev=320944&r1=320943&r2=320944
==============================================================================
--- team/irroot/t38gateway-trunk/channels/chan_local.c (original)
+++ team/irroot/t38gateway-trunk/channels/chan_local.c Thu May 26 04:31:28 2011
@@ -526,25 +526,28 @@
 		return -1;
 
 	/* Just queue for delivery to the other side */
-	while(ao2_trylock(p)) {
-		CHANNEL_DEADLOCK_AVOIDANCE(ast);
-	}
+	ao2_lock(p);
 	ao2_ref(p, 1); /* ref for local_queue_frame */
 
-	/* fixup formats nativeformat has changed we must adjust */
-	bridge = ast_bridged_channel(p->owner);
-	if (bridge && !ast_format_cap_identical(bridge->nativeformats, p->owner->nativeformats)) {
-		ast_format_cap_copy(bridge->nativeformats, p->chan->nativeformats);
-		ast_format_cap_copy(bridge->nativeformats, p->owner->nativeformats);
-		ast_set_read_format(p->owner, &p->owner->readformat);
-		ast_set_write_format(p->owner, &p->owner->writeformat);
-		ast_set_read_format(p->chan, &p->chan->readformat);
-		ast_set_write_format(p->chan, &p->chan->writeformat);
-	}
-
 	isoutbound = IS_OUTBOUND(ast, p);
-	if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO))
+	if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
 		check_bridge(p);
+	} else if (!isoutbound) {
+		/* fixup formats nativeformat has changed we must adjust
+		 * ast is p->owner and is locked here*/
+		bridge = ast_bridged_channel(ast);
+		if (bridge && !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
+			ast_format_cap_copy(bridge->nativeformats, p->owner->nativeformats);
+			ast_set_read_format(ast, &ast->readformat);
+			ast_set_write_format(ast, &ast->writeformat);
+			ast_channel_lock(p->chan);
+			ast_format_cap_copy(bridge->nativeformats, p->chan->nativeformats);
+			ast_set_read_format(p->chan, &p->chan->readformat);
+			ast_set_write_format(p->chan, &p->chan->writeformat);
+			ast_channel_unlock(p->chan);
+		}
+	}
+
 	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED))
 		res = local_queue_frame(p, isoutbound, f, ast, 1);
 	else {

Propchange: team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 26 04:31:28 2011
@@ -1,2 +1,3 @@
 /be/branches/C.3/configs/cel_adaptive_odbc.conf.sample:256426
 /team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample:319062
+/team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample:320771

Propchange: team/irroot/t38gateway-trunk/sounds/Makefile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 26 04:31:28 2011
@@ -1,3 +1,4 @@
 /be/branches/C.3/sounds/Makefile:256426
 /team/irroot/distrotech-customers-1.8/sounds/Makefile:319062
+/team/irroot/distrotech-customers-trunk/sounds/Makefile:320771
 /trunk/sounds/Makefile:270974




More information about the asterisk-commits mailing list