[asterisk-commits] file: trunk r105509 - /trunk/main/slinfactory.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 29 21:59:42 CST 2008


Author: file
Date: Fri Feb 29 21:59:41 2008
New Revision: 105509

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105509
Log:
Add support for 16KHz signed linear.

Modified:
    trunk/main/slinfactory.c

Modified: trunk/main/slinfactory.c
URL: http://svn.digium.com/view/asterisk/trunk/main/slinfactory.c?view=diff&rev=105509&r1=105508&r2=105509
==============================================================================
--- trunk/main/slinfactory.c (original)
+++ trunk/main/slinfactory.c Fri Feb 29 21:59:41 2008
@@ -56,14 +56,14 @@
 	struct ast_frame *begin_frame = f, *duped_frame = NULL, *frame_ptr;
 	unsigned int x;
 
-	if (f->subclass != AST_FORMAT_SLINEAR) {
+	if (f->subclass != AST_FORMAT_SLINEAR && f->subclass != AST_FORMAT_SLINEAR16) {
 		if (sf->trans && f->subclass != sf->format) {
 			ast_translator_free_path(sf->trans);
 			sf->trans = NULL;
 		}
 
 		if (!sf->trans) {
-			if (!(sf->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, f->subclass))) {
+			if (!(sf->trans = ast_translator_build_path((f->subclass == AST_FORMAT_G722 ? AST_FORMAT_SLINEAR16 : AST_FORMAT_SLINEAR), f->subclass))) {
 				ast_log(LOG_WARNING, "Cannot build a path from %s to slin\n", ast_getformatname(f->subclass));
 				return 0;
 			}




More information about the asterisk-commits mailing list