From 273696f653d4c3ed2ebdbb3ee7f7b9bc931d4925 Mon Sep 17 00:00:00 2001 From: Kelly Davis Date: Sat, 22 Aug 2015 10:08:00 -0400 Subject: [PATCH] Bug 1197455 - Call ps_set_search() only after successful grammar compilation. r=anatal --- .../recognition/PocketSphinxSpeechRecognitionService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp b/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp index 83f09d4c293..c043637c68d 100644 --- a/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp +++ b/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp @@ -277,11 +277,11 @@ PocketSphinxSpeechRecognitionService::ValidateAndSetGrammarList( int result = ps_set_jsgf_string(mPSHandle, "name", NS_ConvertUTF16toUTF8(grammar).get()); - ps_set_search(mPSHandle, "name"); - if (result != 0) { ISGrammarCompiled = false; } else { + ps_set_search(mPSHandle, "name"); + ISGrammarCompiled = true; } } else {