[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step3 r302407 - /team/dvossel/fixt...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 18 17:41:47 CST 2011


Author: dvossel
Date: Tue Jan 18 17:41:42 2011
New Revision: 302407

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=302407
Log:
replaced unnecessary usage of cap append with copy

Modified:
    team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c?view=diff&rev=302407&r1=302406&r2=302407
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c Tue Jan 18 17:41:42 2011
@@ -6589,15 +6589,15 @@
 	/* Select our native format based on codec preference until we receive
 	   something from another device to the contrary. */
 	if (!(ast_format_cap_is_empty(i->jointcaps))) {	/* The joint capabilities of us and peer */
-		ast_format_cap_append(what, i->jointcaps);
+		ast_format_cap_copy2(what, i->jointcaps);
 		video = ast_format_cap_get_type(i->jointcaps, AST_FORMAT_TYPE_VIDEO);
 		text = ast_format_cap_get_type(i->jointcaps, AST_FORMAT_TYPE_TEXT);
 	} else if (!(ast_format_cap_is_empty(i->caps))) {		/* Our configured capability for this peer */
-		ast_format_cap_append(what, i->caps);
+		ast_format_cap_copy2(what, i->caps);
 		video = ast_format_cap_get_type(i->caps, AST_FORMAT_TYPE_VIDEO);
 		text = ast_format_cap_get_type(i->caps, AST_FORMAT_TYPE_TEXT);
 	} else {
-		ast_format_cap_append(what, sip_cfg.caps);	/* Global codec support */
+		ast_format_cap_copy2(what, sip_cfg.caps);	/* Global codec support */
 		video = ast_format_cap_get_type(sip_cfg.caps, AST_FORMAT_TYPE_VIDEO);
 		text = ast_format_cap_get_type(sip_cfg.caps, AST_FORMAT_TYPE_TEXT);
 	}
@@ -6611,6 +6611,7 @@
 		ast_format_cap_append(tmp->nativeformats, text);
 	}
 	ast_format_cap_add(tmp->nativeformats, &fmt);
+
 	ast_debug(3, "*** Our native formats are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, tmp->nativeformats));
 	ast_debug(3, "*** Joint capabilities are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->jointcaps));
 	ast_debug(3, "*** Our capabilities are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->caps));
@@ -6618,9 +6619,6 @@
 	if (!ast_format_cap_is_empty(i->prefcaps)) {
 		ast_debug(3, "*** Our preferred formats from the incoming channel are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->prefcaps));
 	}
-
-	/* XXX Why are we choosing a codec from the native formats?? */
-	ast_best_codec(tmp->nativeformats, &fmt);
 
 	/* If we have a prefcodec setting, we have an inbound channel that set a
 	   preferred format for this call. Otherwise, we check the jointcapability
@@ -6777,9 +6775,9 @@
 			tmp->name, tmp->uniqueid, "SIP", i->callid, i->fullcontact);
 	}
 
-	ast_format_cap_destroy(what);
-	ast_format_cap_destroy(video);
-	ast_format_cap_destroy(text);
+	what = ast_format_cap_destroy(what);
+	video = ast_format_cap_destroy(video);
+	text = ast_format_cap_destroy(text);
 
 	return tmp;
 }




More information about the asterisk-commits mailing list