summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 7e8311e847..c7e2e035fd 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -95,6 +95,7 @@ static long silence_len; /* length of the VOICE_PAUSE clip */
95static unsigned char* p_lastclip; /* address of latest clip, for silence add */ 95static unsigned char* p_lastclip; /* address of latest clip, for silence add */
96static unsigned long voicefile_size = 0; /* size of the loaded voice file */ 96static unsigned long voicefile_size = 0; /* size of the loaded voice file */
97static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ 97static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */
98static bool talk_initialized; /* true if talk_init has been called */
98 99
99/***************** Private prototypes *****************/ 100/***************** Private prototypes *****************/
100 101
@@ -473,12 +474,13 @@ static void reset_state(void)
473 474
474void talk_init(void) 475void talk_init(void)
475{ 476{
476 if (!strcasecmp(last_lang, global_settings.lang_file)) 477 if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file))
477 { 478 {
478 /* not a new file, nothing to do */ 479 /* not a new file, nothing to do */
479 return; 480 return;
480 } 481 }
481 482
483 talk_initialized = true;
482 strncpy((char *) last_lang, (char *)global_settings.lang_file, 484 strncpy((char *) last_lang, (char *)global_settings.lang_file,
483 MAX_FILENAME); 485 MAX_FILENAME);
484 486