]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add a flag to the speech API that allows an engine to set whether it received results...
authorJoshua Colp <jcolp@digium.com>
Tue, 31 Jul 2007 16:17:09 +0000 (16:17 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 31 Jul 2007 16:17:09 +0000 (16:17 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77831 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/speech.h
res/res_speech.c

index 3af01e614d07c4e99911532f50a0e16fef7142bd..85e17edf2ac6238d4fa359fb9ecef051b4ff5c08 100644 (file)
@@ -28,8 +28,9 @@ extern "C" {
 #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 */
index 16673538bcda27ef750072800d616394fbf02adb..73dfe8dec646d9b52fde637e33b72cd5ee579317 100644 (file)
@@ -120,7 +120,7 @@ struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
 {
        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 @@ void ast_speech_start(struct ast_speech *speech)
        /* 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) {