forked from len0rd/rockbox
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
This commit is contained in:
parent
a3cfe0a434
commit
b1c5676927
1 changed files with 11 additions and 1 deletions
12
apps/talk.c
12
apps/talk.c
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
@ -93,7 +94,7 @@ static unsigned char* p_silence; /* VOICE_PAUSE clip, used for termination */
|
||||||
static long silence_len; /* length of the VOICE_PAUSE clip */
|
static long silence_len; /* length of the VOICE_PAUSE clip */
|
||||||
static unsigned char* p_lastclip; /* address of latest clip, for silence add */
|
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 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) */
|
||||||
|
|
||||||
/***************** Private prototypes *****************/
|
/***************** Private prototypes *****************/
|
||||||
|
|
||||||
|
|
@ -472,6 +473,15 @@ static void reset_state(void)
|
||||||
|
|
||||||
void talk_init(void)
|
void talk_init(void)
|
||||||
{
|
{
|
||||||
|
if (!strcasecmp(last_lang, global_settings.lang_file))
|
||||||
|
{
|
||||||
|
/* not a new file, nothing to do */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy((char *) last_lang, (char *)global_settings.lang_file,
|
||||||
|
MAX_FILENAME);
|
||||||
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
audio_stop();
|
audio_stop();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue