summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2006-02-23 21:29:29 +0000
committerMagnus Holmgren <magnushol@gmail.com>2006-02-23 21:29:29 +0000
commitb1c5676927a4122bc4666205559ce80be679a7ea (patch)
tree4b65fd1b4b6373e1b60fd103ba3ff5a09693f54c
parenta3cfe0a434fd1ef5e4a59e34499d10cd0211f76b (diff)
downloadrockbox-b1c5676927a4122bc4666205559ce80be679a7ea.tar.gz
rockbox-b1c5676927a4122bc4666205559ce80be679a7ea.zip
Quick fix to not stop audio playback on .cfg file load unless language setting has changed. (Could be taken one step further to only stop playback if there's been a change in voice file use.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8817 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/talk.c12
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 */
93static long silence_len; /* length of the VOICE_PAUSE clip */ 94static long silence_len; /* length of the VOICE_PAUSE clip */
94static unsigned char* p_lastclip; /* address of latest clip, for silence add */ 95static unsigned char* p_lastclip; /* address of latest clip, for silence add */
95static unsigned long voicefile_size = 0; /* size of the loaded voice file */ 96static unsigned long voicefile_size = 0; /* size of the loaded voice file */
96 97static 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
473void talk_init(void) 474void 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