[asterisk-commits] file: branch file/ah r59192 - in /team/file/ah: include/asterisk/ main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Mar 23 10:11:36 MST 2007


Author: file
Date: Fri Mar 23 12:11:35 2007
New Revision: 59192

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59192
Log:
Add API call to slinfactory to flush the factory.

Modified:
    team/file/ah/include/asterisk/slinfactory.h
    team/file/ah/main/slinfactory.c

Modified: team/file/ah/include/asterisk/slinfactory.h
URL: http://svn.digium.com/view/asterisk/team/file/ah/include/asterisk/slinfactory.h?view=diff&rev=59192&r1=59191&r2=59192
==============================================================================
--- team/file/ah/include/asterisk/slinfactory.h (original)
+++ team/file/ah/include/asterisk/slinfactory.h Fri Mar 23 12:11:35 2007
@@ -46,6 +46,7 @@
 int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f);
 int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples);
 unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf);
+void ast_slinfactory_flush(struct ast_slinfactory *sf);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/file/ah/main/slinfactory.c
URL: http://svn.digium.com/view/asterisk/team/file/ah/main/slinfactory.c?view=diff&rev=59192&r1=59191&r2=59192
==============================================================================
--- team/file/ah/main/slinfactory.c (original)
+++ team/file/ah/main/slinfactory.c Fri Mar 23 12:11:35 2007
@@ -143,3 +143,21 @@
 {
 	return sf->size;
 }
+
+void ast_slinfactory_flush(struct ast_slinfactory *sf)
+{
+	struct ast_frame *fr = NULL;
+
+	if (sf->trans) {
+		ast_translator_free_path(sf->trans);
+		sf->trans = NULL;
+	}
+
+	while ((fr = AST_LIST_REMOVE_HEAD(&sf->queue, frame_list)))
+		ast_frfree(fr);
+
+	sf->size = sf->holdlen = 0;
+	sf->offset = sf->hold;
+
+	return;
+}



More information about the asterisk-commits mailing list