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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 13 17:34:39 CST 2011


Author: dvossel
Date: Thu Jan 13 17:34:35 2011
New Revision: 301783

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=301783
Log:
correct usage of ast_format_cmp

Modified:
    team/dvossel/fixtheworld_phase1_step3/main/audiohook.c
    team/dvossel/fixtheworld_phase1_step3/main/channel.c
    team/dvossel/fixtheworld_phase1_step3/main/file.c
    team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c

Modified: team/dvossel/fixtheworld_phase1_step3/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/audiohook.c?view=diff&rev=301783&r1=301782&r2=301783
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/audiohook.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/audiohook.c Thu Jan 13 17:34:35 2011
@@ -315,7 +315,7 @@
 	/* If they don't want signed linear back out, we'll have to send it through the translation path */
 	if (format->id != AST_FORMAT_SLINEAR) {
 		/* Rebuild translation path if different format then previously */
-		if (ast_format_cmp(&audiohook->format, format) == AST_FORMAT_CMP_NOT_EQUAL) {
+		if (ast_format_cmp(format, &audiohook->format) == AST_FORMAT_CMP_NOT_EQUAL) {
 			if (audiohook->trans_pvt) {
 				ast_translator_free_path(audiohook->trans_pvt);
 				audiohook->trans_pvt = NULL;
@@ -626,7 +626,7 @@
 	/* ---Part_1. translate start_frame to SLINEAR if necessary. */
 	/* If the frame coming in is not signed linear we have to send it through the in_translate path */
 	if (frame->subclass.format.id != AST_FORMAT_SLINEAR) {
-		if (ast_format_cmp(&in_translate->format, &frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
+		if (ast_format_cmp(&frame->subclass.format, &in_translate->format) == AST_FORMAT_CMP_NOT_EQUAL) {
 			if (in_translate->trans_pvt)
 				ast_translator_free_path(in_translate->trans_pvt);
 			if (!(in_translate->trans_pvt = ast_translator_build_path(ast_format_set(&tmp_fmt, AST_FORMAT_SLINEAR, 0), &frame->subclass.format)))

Modified: team/dvossel/fixtheworld_phase1_step3/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/channel.c?view=diff&rev=301783&r1=301782&r2=301783
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/channel.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/channel.c Thu Jan 13 17:34:35 2011
@@ -5717,7 +5717,7 @@
 	}
 
 	if ((ast_format_cmp(&from->readformat, &to->writeformat) != AST_FORMAT_CMP_NOT_EQUAL) &&
-		(ast_format_cmp(&from->writeformat, &to->readformat) != AST_FORMAT_CMP_NOT_EQUAL)) {
+		(ast_format_cmp(&to->readformat, &from->writeformat) != AST_FORMAT_CMP_NOT_EQUAL)) {
 		/* Already compatible!  Moving on ... */
 		return 0;
 	}
@@ -7385,7 +7385,7 @@
 			}
 		}
 
-		if (((ast_format_cmp(&c0->writeformat, &c1->readformat) == AST_FORMAT_CMP_NOT_EQUAL) ||
+		if (((ast_format_cmp(&c1->readformat, &c0->writeformat) == AST_FORMAT_CMP_NOT_EQUAL) ||
 			(ast_format_cmp(&c0->readformat, &c1->writeformat) == AST_FORMAT_CMP_NOT_EQUAL) ||
 		    !ast_cap_identical(c0->nativeformats, o0nativeformats) ||
 			!ast_cap_identical(c1->nativeformats, o1nativeformats)) &&

Modified: team/dvossel/fixtheworld_phase1_step3/main/file.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/file.c?view=diff&rev=301783&r1=301782&r2=301783
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/file.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/file.c Thu Jan 13 17:34:35 2011
@@ -168,7 +168,7 @@
 		ast_log(LOG_WARNING, "Tried to write non-voice frame\n");
 		return -1;
 	}
-	if ((ast_format_cmp(&fs->fmt->format, &f->subclass.format) == AST_FORMAT_CMP_EQUAL)) {
+	if (ast_format_cmp(&f->subclass.format, &fs->fmt->format) != AST_FORMAT_CMP_NOT_EQUAL) {
 		res =  fs->fmt->write(fs, f);
 		if (res < 0) 
 			ast_log(LOG_WARNING, "Natural write failed\n");

Modified: team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c?view=diff&rev=301783&r1=301782&r2=301783
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c Thu Jan 13 17:34:35 2011
@@ -657,7 +657,7 @@
 
 	for (i = 0; i < AST_RTP_MAX_PT; i++) {
 		if (codecs->payloads[i].asterisk_format && asterisk_format && format &&
-			(ast_format_cmp(&codecs->payloads[i].format, format) == AST_FORMAT_CMP_EQUAL)) {
+			(ast_format_cmp(format, &codecs->payloads[i].format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			return i;
 		} else if (!codecs->payloads[i].asterisk_format && !asterisk_format &&
 			(codecs->payloads[i].rtp_code == code)) {
@@ -667,7 +667,7 @@
 
 	for (i = 0; i < AST_RTP_MAX_PT; i++) {
 		if (static_RTP_PT[i].asterisk_format && asterisk_format && format &&
-			(ast_format_cmp(&static_RTP_PT[i].format, format) == AST_FORMAT_CMP_EQUAL)) {
+			(ast_format_cmp(format, &static_RTP_PT[i].format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			return i;
 		} else if (!static_RTP_PT[i].asterisk_format && !asterisk_format &&
 			(static_RTP_PT[i].rtp_code == code)) {
@@ -684,7 +684,7 @@
 
 	for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); i++) {
 		if (ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
-			(ast_format_cmp(&ast_rtp_mime_types[i].payload_type.format, format) == AST_FORMAT_CMP_EQUAL)) {
+			(ast_format_cmp(format, &ast_rtp_mime_types[i].payload_type.format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			if ((format->id == AST_FORMAT_G726_AAL2) && (options & AST_RTP_OPT_G726_NONSTANDARD)) {
 				return "G726-32";
 			} else {
@@ -706,7 +706,7 @@
 
 	for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); ++i) {
 		if (ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
-			(ast_format_cmp(&ast_rtp_mime_types[i].payload_type.format, format) == AST_FORMAT_CMP_EQUAL)) {
+			(ast_format_cmp(format, &ast_rtp_mime_types[i].payload_type.format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			return ast_rtp_mime_types[i].sample_rate;
 		} else if (!ast_rtp_mime_types[i].payload_type.asterisk_format && !asterisk_format &&
 			ast_rtp_mime_types[i].payload_type.rtp_code == code) {




More information about the asterisk-commits mailing list