[asterisk-commits] file: trunk r77833 - in /trunk: ./ include/asterisk/speech.h res/res_speech.c

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


Author: file
Date: Tue Jul 31 11:21:34 2007
New Revision: 77833

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77833
Log:
Merged revisions 77831 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77831 | file | 2007-07-31 13:17:09 -0300 (Tue, 31 Jul 2007) | 2 lines

Add a flag to the speech API that allows an engine to set whether it received results or not.

........

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/speech.h
    trunk/res/res_speech.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/speech.h?view=diff&rev=77833&r1=77832&r2=77833
==============================================================================
--- trunk/include/asterisk/speech.h (original)
+++ trunk/include/asterisk/speech.h Tue Jul 31 11:21:34 2007
@@ -29,8 +29,9 @@
 
 /* Speech structure flags */
 enum ast_speech_flags {
-	AST_SPEECH_QUIET = (1 << 0), /* Quiet down output... they are talking */
-	AST_SPEECH_SPOKE = (1 << 1), /* Speaker spoke! */
+	AST_SPEECH_QUIET = (1 << 0),        /* Quiet down output... they are talking */
+	AST_SPEECH_SPOKE = (1 << 1),        /* Speaker spoke! */
+	AST_SPEECH_HAVE_RESULTS = (1 << 2), /* Results are present */
 };
 
 /* Speech structure states - in order of expected change */

Modified: trunk/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_speech.c?view=diff&rev=77833&r1=77832&r2=77833
==============================================================================
--- trunk/res/res_speech.c (original)
+++ trunk/res/res_speech.c Tue Jul 31 11:21:34 2007
@@ -92,7 +92,7 @@
 /*! \brief Return the results of a recognition from the speech structure */
 struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
 {
-	return (speech->engine->get ? speech->engine->get(speech) : NULL);
+	return ((speech->engine->get && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) ? speech->engine->get(speech) : NULL);
 }
 
 /*! \brief Free a list of results */
@@ -128,6 +128,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) {




More information about the asterisk-commits mailing list