diff options
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index 07ee93bc16..7e8311e847 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stddef.h> | 25 | #include <stddef.h> |
26 | #include <string.h> | ||
26 | #include "file.h" | 27 | #include "file.h" |
27 | #include "buffer.h" | 28 | #include "buffer.h" |
28 | #include "system.h" | 29 | #include "system.h" |
@@ -93,7 +94,7 @@ static unsigned char* p_silence; /* VOICE_PAUSE clip, used for termination */ | |||
93 | static long silence_len; /* length of the VOICE_PAUSE clip */ | 94 | static long silence_len; /* length of the VOICE_PAUSE clip */ |
94 | static unsigned char* p_lastclip; /* address of latest clip, for silence add */ | 95 | static unsigned char* p_lastclip; /* address of latest clip, for silence add */ |
95 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ | 96 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ |
96 | 97 | static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ | |
97 | 98 | ||
98 | /***************** Private prototypes *****************/ | 99 | /***************** Private prototypes *****************/ |
99 | 100 | ||
@@ -472,6 +473,15 @@ static void reset_state(void) | |||
472 | 473 | ||
473 | void talk_init(void) | 474 | void talk_init(void) |
474 | { | 475 | { |
476 | if (!strcasecmp(last_lang, global_settings.lang_file)) | ||
477 | { | ||
478 | /* not a new file, nothing to do */ | ||
479 | return; | ||
480 | } | ||
481 | |||
482 | strncpy((char *) last_lang, (char *)global_settings.lang_file, | ||
483 | MAX_FILENAME); | ||
484 | |||
475 | #if CONFIG_CODEC == SWCODEC | 485 | #if CONFIG_CODEC == SWCODEC |
476 | audio_stop(); | 486 | audio_stop(); |
477 | #endif | 487 | #endif |