loading a setting (and internally calling talk_init) caused the playback to stop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5027 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
06cb237af6
commit
3e41780d44
1 changed files with 10 additions and 5 deletions
15
apps/talk.c
15
apps/talk.c
|
@ -290,6 +290,14 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue)
|
|||
}
|
||||
|
||||
|
||||
static void reset_state(void)
|
||||
{
|
||||
queue_write = queue_read = 0; /* reset the queue */
|
||||
p_voicefile = NULL; /* indicate no voicefile (trashed) */
|
||||
p_thumbnail = mp3buf; /* whole space for thumbnail */
|
||||
size_for_thumbnail = mp3end - mp3buf;
|
||||
}
|
||||
|
||||
/***************** Public implementation *****************/
|
||||
|
||||
void talk_init(void)
|
||||
|
@ -307,7 +315,7 @@ void talk_init(void)
|
|||
has_voicefile = false; /* no voice file available */
|
||||
}
|
||||
|
||||
talk_buffer_steal(); /* abuse this for most of our inits */
|
||||
reset_state(); /* use this for most of our inits */
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,10 +323,7 @@ void talk_init(void)
|
|||
int talk_buffer_steal(void)
|
||||
{
|
||||
mp3_play_stop();
|
||||
queue_write = queue_read = 0; /* reset the queue */
|
||||
p_voicefile = NULL; /* indicate no voicefile (trashed) */
|
||||
p_thumbnail = mp3buf; /* whole space for thumbnail */
|
||||
size_for_thumbnail = mp3end - mp3buf;
|
||||
reset_state();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue