summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2006-02-26 16:07:34 +0000
committerMagnus Holmgren <magnushol@gmail.com>2006-02-26 16:07:34 +0000
commit7ac7317038fbfc8a2ed86b8a68f933897b94fd33 (patch)
tree88790455bb9f30bdb9012d05ac1bc3dcf9f48288 /apps/talk.c
parent2f76763d73c7be641cd55c30ff15f6ff9dda5fe0 (diff)
downloadrockbox-7ac7317038fbfc8a2ed86b8a68f933897b94fd33.zip
rockbox-7ac7317038fbfc8a2ed86b8a68f933897b94fd33.tar.gz
rockbox-7ac7317038fbfc8a2ed86b8a68f933897b94fd33.tar.bz2
rockbox-7ac7317038fbfc8a2ed86b8a68f933897b94fd33.tar.xz
Previous fix broke voice init when no language file had been selected. Fix that by making sure voice init is run at least once.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8848 a1c6a512-1295-4272-9138-f99709370657
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 7e8311e..c7e2e03 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -95,6 +95,7 @@ static long silence_len; /* length of the VOICE_PAUSE clip */
static unsigned char* p_lastclip; /* address of latest clip, for silence add */
static unsigned long voicefile_size = 0; /* size of the loaded voice file */
static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */
+static bool talk_initialized; /* true if talk_init has been called */
/***************** Private prototypes *****************/
@@ -473,12 +474,13 @@ static void reset_state(void)
void talk_init(void)
{
- if (!strcasecmp(last_lang, global_settings.lang_file))
+ if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file))
{
/* not a new file, nothing to do */
return;
}
+ talk_initialized = true;
strncpy((char *) last_lang, (char *)global_settings.lang_file,
MAX_FILENAME);