[svn-commits] file: trunk r66126 - /trunk/main/slinfactory.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri May 25 06:26:54 MST 2007


Author: file
Date: Fri May 25 08:26:52 2007
New Revision: 66126

URL: http://svn.digium.com/view/asterisk?view=rev&rev=66126
Log:
Minor tweak... drop translation path if one exists when we get an already signed linear frame in. Chances are the stream has then switched to signed linear and we no longer need the path.

Modified:
    trunk/main/slinfactory.c

Modified: trunk/main/slinfactory.c
URL: http://svn.digium.com/view/asterisk/trunk/main/slinfactory.c?view=diff&rev=66126&r1=66125&r2=66126
==============================================================================
--- trunk/main/slinfactory.c (original)
+++ trunk/main/slinfactory.c Fri May 25 08:26:52 2007
@@ -65,16 +65,19 @@
 			sf->trans = NULL;
 		}
 		if (!sf->trans) {
-			if ((sf->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, f->subclass)) == NULL) {
+			if (!(sf->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, f->subclass))) {
 				ast_log(LOG_WARNING, "Cannot build a path from %s to slin\n", ast_getformatname(f->subclass));
 				return 0;
-			} else {
-				sf->format = f->subclass;
 			}
+			sf->format = f->subclass;
 		}
 		if (!(begin_frame = ast_translate(sf->trans, f, 0)) || !(duped_frame = ast_frdup(begin_frame)))
 			return 0;
 	} else {
+		if (sf->trans) {
+			ast_translator_free_path(sf->trans);
+			sf->trans = NULL;
+		}
 		if (!(duped_frame = ast_frdup(f)))
 			return 0;
 	}



More information about the svn-commits mailing list