[Freeswitch-svn] [commit] r9046 - freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx

Freeswitch SVN brian at freeswitch.org
Tue Jul 15 16:35:33 EDT 2008


Author: brian
Date: Tue Jul 15 16:35:32 2008
New Revision: 9046

Modified:
   freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c

Log:
small tweak

Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	Tue Jul 15 16:35:32 2008
@@ -261,17 +261,6 @@
 	if (switch_test_flag(ah, SWITCH_ASR_FLAG_CLOSED)) return SWITCH_STATUS_BREAK; 
 	
 	if (!switch_test_flag(ps, PSFLAG_HAS_TEXT) && switch_test_flag(ps, PSFLAG_READY)) {
-		/* only feed ps_process_raw when we are listening */
-		if (ps->listening) {
-			switch_mutex_lock(ps->flag_mutex);
-			rv = ps_process_raw(ps->ps, (int16 *)data, len / 2 , FALSE, FALSE);
-			switch_mutex_unlock(ps->flag_mutex);
-		}
-
-		if (rv < 0) {
-			return SWITCH_STATUS_FALSE;
-		}
-
 		if (stop_detect(ps, (int16_t *)data, len / 2)) {
 			char const *hyp;
 
@@ -294,6 +283,17 @@
 			}
 			switch_mutex_unlock(ps->flag_mutex);
 		}
+
+		/* only feed ps_process_raw when we are listening */
+		if (ps->listening) {
+			switch_mutex_lock(ps->flag_mutex);
+			rv = ps_process_raw(ps->ps, (int16 *)data, len / 2 , FALSE, FALSE);
+			switch_mutex_unlock(ps->flag_mutex);
+		}
+
+		if (rv < 0) {
+			return SWITCH_STATUS_FALSE;
+		}
 	}
 
 	return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list