[svn-commits] mjordan: branch 13 r432423 - /branches/13/res/res_pjsip_sdp_rtp.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 2 13:14:26 CST 2015


Author: mjordan
Date: Mon Mar  2 13:14:19 2015
New Revision: 432423

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432423
Log:
res/res_pjsip_sdp_rtp: Revert portion of r432195

Unfortunately, while initial testing with ConfBridge did not reproduce the
audio problem alluded to in the comment in res_pjsip_sdp_rtp, further testing
did show that bridge_softmix and/or ConfBridge has a severe problem bridging
two or more participants at different sampling rates. Sometimes, it even picks
odd sampling rates that cause hideous audio problems.

This patch backs out the offending portion of the code until the issues in
the affected bridging modules can be more properly analyzed.

ASTERISK-24841

Modified:
    branches/13/res/res_pjsip_sdp_rtp.c

Modified: branches/13/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_sdp_rtp.c?view=diff&rev=432423&r1=432422&r2=432423
==============================================================================
--- branches/13/res/res_pjsip_sdp_rtp.c (original)
+++ branches/13/res/res_pjsip_sdp_rtp.c Mon Mar  2 13:14:19 2015
@@ -240,8 +240,8 @@
 	/* get the joint capabilities between peer and endpoint */
 	ast_format_cap_get_compatible(caps, peer, joint);
 	if (!ast_format_cap_count(joint)) {
-		struct ast_str *usbuf = ast_str_alloca(256);
-		struct ast_str *thembuf = ast_str_alloca(256);
+		struct ast_str *usbuf = ast_str_alloca(64);
+		struct ast_str *thembuf = ast_str_alloca(64);
 
 		ast_rtp_codecs_payloads_destroy(&codecs);
 		ast_log(LOG_NOTICE, "No joint capabilities for '%s' media stream between our configuration(%s) and incoming SDP(%s)\n",
@@ -257,17 +257,36 @@
 	ast_format_cap_append_from_cap(session->req_caps, joint, AST_MEDIA_TYPE_UNKNOWN);
 
 	if (session->channel) {
+		struct ast_format *fmt;
 
 		ast_channel_lock(session->channel);
+		ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_UNKNOWN);
+		ast_format_cap_append_from_cap(caps, ast_channel_nativeformats(session->channel), AST_MEDIA_TYPE_UNKNOWN);
+		ast_format_cap_remove_by_type(caps, media_type);
+
+		/*
+		 * XXX Historically we picked the "best" joint format to use
+		 * and stuck with it.  It would be nice to just append the
+		 * determined joint media capabilities to give translation
+		 * more formats to choose from when necessary.  Unfortunately,
+		 * there are some areas of the system where this doesn't work
+		 * very well. (The softmix bridge in particular is reluctant
+		 * to pick higher fidelity formats and has a problem with
+		 * asymmetric sample rates.)
+		 */
+		fmt = ast_format_cap_get_format(joint, 0);
+		ast_format_cap_append(caps, fmt, 0);
 
 		/*
 		 * Apply the new formats to the channel, potentially changing
 		 * raw read/write formats and translation path while doing so.
 		 */
-		ast_channel_nativeformats_set(session->channel, joint);
+		ast_channel_nativeformats_set(session->channel, caps);
 		ast_set_read_format(session->channel, ast_channel_readformat(session->channel));
 		ast_set_write_format(session->channel, ast_channel_writeformat(session->channel));
 		ast_channel_unlock(session->channel);
+
+		ao2_ref(fmt, -1);
 	}
 
 	ast_rtp_codecs_payloads_destroy(&codecs);




More information about the svn-commits mailing list