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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 18 16:27:23 CST 2011


Author: dvossel
Date: Tue Jan 18 16:27:18 2011
New Revision: 302366

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=302366
Log:
fixes logic in free_translation code

Modified:
    team/dvossel/fixtheworld_phase1_step3/main/channel.c

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=302366&r1=302365&r2=302366
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/channel.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/channel.c Tue Jan 18 16:27:18 2011
@@ -2637,8 +2637,15 @@
 		ast_translator_free_path(clonechan->readtrans);
 	clonechan->writetrans = NULL;
 	clonechan->readtrans = NULL;
-	ast_best_codec(clonechan->nativeformats, &clonechan->rawwriteformat);
-	ast_best_codec(clonechan->nativeformats, &clonechan->rawreadformat);
+	if (ast_format_cap_is_empty(clonechan->nativeformats)) {
+		ast_format_clear(&clonechan->rawwriteformat);
+		ast_format_clear(&clonechan->rawreadformat);
+	} else {
+		struct ast_format tmpfmt;
+		ast_best_codec(clonechan->nativeformats, &tmpfmt);
+		ast_format_copy(&clonechan->rawwriteformat, &tmpfmt);
+		ast_format_copy(&clonechan->rawreadformat, &tmpfmt);
+	}
 }
 
 void ast_set_hangupsource(struct ast_channel *chan, const char *source, int force)




More information about the asterisk-commits mailing list