diff options
| author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-08-31 22:13:20 +0000 |
|---|---|---|
| committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-08-31 22:13:20 +0000 |
| commit | 3e41780d44ff361ea4ad1a4472d44461e06be4cc (patch) | |
| tree | 7f1cfcf2bb256073200f77f070b32f0c85757784 /apps | |
| parent | 06cb237af682fbc45a72c4e43e3f8126b2c9cac6 (diff) | |
| download | rockbox-3e41780d44ff361ea4ad1a4472d44461e06be4cc.zip rockbox-3e41780d44ff361ea4ad1a4472d44461e06be4cc.tar.gz rockbox-3e41780d44ff361ea4ad1a4472d44461e06be4cc.tar.bz2 rockbox-3e41780d44ff361ea4ad1a4472d44461e06be4cc.tar.xz | |
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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/talk.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/talk.c b/apps/talk.c index 83acbb0..941af1d 100644 --- a/apps/talk.c +++ b/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; } |