From 7baa450738b20436a6179609eeea48784da2a50f Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 6 Nov 2011 12:01:38 +0000 Subject: 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 --- apps/talk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') 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; -- cgit v1.2.3