From 3e41780d44ff361ea4ad1a4472d44461e06be4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohensohn?= Date: Tue, 31 Aug 2004 22:13:20 +0000 Subject: [PATCH] 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 --- apps/talk.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/talk.c b/apps/talk.c index 83acbb09d5..941af1dfd9 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; }