summaryrefslogtreecommitdiffstats
path: root/apps/talk.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-11-06 12:01:38 +0000
committerThomas Martitz <kugel@rockbox.org>2011-11-06 12:01:38 +0000
commit7baa450738b20436a6179609eeea48784da2a50f (patch)
tree3e51139a9d3f7580c6522f3b911ea070890ad061 /apps/talk.c
parent2ce48832d88dfce6539500081b8916d5762c4c26 (diff)
downloadrockbox-7baa450738b20436a6179609eeea48784da2a50f.tar.gz
rockbox-7baa450738b20436a6179609eeea48784da2a50f.tar.bz2
rockbox-7baa450738b20436a6179609eeea48784da2a50f.zip
Fix broken voice when .talk files are used and voice buffer calculation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30909 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/talk.c b/apps/talk.c
index ea6432dc21..b9bfdc82ac 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -402,7 +402,6 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize)
if (alloc_size > bufsize)
goto load_err;
- return;
/* now move p_thumbnail behind the voice clip buffer */
p_thumbnail = voicebuf.buf + alloc_size;
@@ -414,6 +413,7 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize)
if (size_for_thumbnail <= 0)
p_thumbnail = NULL;
+ return;
load_err:
p_voicefile = NULL;
has_voicefile = false; /* don't try again */
@@ -778,7 +778,7 @@ void talk_buffer_steal(void)
int talk_id(int32_t id, bool enqueue)
{
long clipsize;
- size_t temp = voicefile_size;
+ size_t temp = talk_get_buffer();
unsigned char* clipbuf;
int32_t unit;
int decimals;
@@ -795,7 +795,7 @@ int talk_id(int32_t id, bool enqueue)
voicebuf = audio_get_buffer(true, &temp);
if (p_voicefile == NULL && has_voicefile)
- load_voicefile(false, voicebuf, MIN(voicefile_size,temp)); /* reload needed */
+ load_voicefile(false, voicebuf, MIN(talk_get_buffer(),temp)); /* reload needed */
if (p_voicefile == NULL) /* still no voices? */
return -1;