From 1d073289188fd9ba0fa690d95157e2392fd7f98c Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 31 Jul 2007 16:21:34 +0000 Subject: 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. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77833 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_speech.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'res') diff --git a/res/res_speech.c b/res/res_speech.c index cf830344f..ed815b6ec 100644 --- a/res/res_speech.c +++ b/res/res_speech.c @@ -92,7 +92,7 @@ int ast_speech_grammar_unload(struct ast_speech *speech, char *grammar_name) /*! \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 @@ 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) { -- cgit v1.2.3