[asterisk-commits] file: branch 1.4 r77831 - in /branches/1.4: include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 31 11:17:10 CDT 2007


Author: file
Date: Tue Jul 31 11:17:09 2007
New Revision: 77831

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77831
Log:
Add a flag to the speech API that allows an engine to set whether it received results or not.

Modified:
    branches/1.4/include/asterisk/speech.h
    branches/1.4/res/res_speech.c

Modified: branches/1.4/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/speech.h?view=diff&rev=77831&r1=77830&r2=77831
==============================================================================
--- branches/1.4/include/asterisk/speech.h (original)
+++ branches/1.4/include/asterisk/speech.h Tue Jul 31 11:17:09 2007
@@ -28,8 +28,9 @@
 #endif
 
 /* Speech structure flags */
-#define AST_SPEECH_QUIET (1 << 0) /* Quiet down output... they are talking */
-#define AST_SPEECH_SPOKE (1 << 1) /* Speaker did not speak */
+#define AST_SPEECH_QUIET (1 << 0)        /* Quiet down output... they are talking */
+#define AST_SPEECH_SPOKE (1 << 1)        /* Speaker did not speak */
+#define AST_SPEECH_HAVE_RESULTS (1 << 2) /* Results are present */
 
 /* Speech structure states - in order of expected change */
 #define AST_SPEECH_STATE_NOT_READY 0 /* Not ready to accept audio */

Modified: branches/1.4/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_speech.c?view=diff&rev=77831&r1=77830&r2=77831
==============================================================================
--- branches/1.4/res/res_speech.c (original)
+++ branches/1.4/res/res_speech.c Tue Jul 31 11:17:09 2007
@@ -120,7 +120,7 @@
 {
 	struct ast_speech_result *result = NULL;
 
-	if (speech->engine->get != NULL) {
+	if (speech->engine->get != NULL && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) {
 		result = speech->engine->get(speech);
 	}
 
@@ -160,6 +160,7 @@
 	/* Clear any flags that may affect things */
 	ast_clear_flag(speech, AST_SPEECH_SPOKE);
 	ast_clear_flag(speech, AST_SPEECH_QUIET);
+	ast_clear_flag(speech, AST_SPEECH_HAVE_RESULTS);
 
 	/* If results are on the structure, free them since we are starting again */
 	if (speech->results != NULL) {




More information about the asterisk-commits mailing list