diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-08-22 10:23:11 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-08-22 10:23:11 +0000 |
commit | fbde6baab59d7c8d047ef267884373d6d9f9e59d (patch) | |
tree | dcc35ded25cd22218c61b545b5a44d5f91ca6c08 | |
parent | b66d07a9e3a27af3a6b4d2cba8e7909b9beab46d (diff) |
Move stuff a bit down to fix red on TALK_PARTIAL_LOAD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30339 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/talk.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/apps/talk.c b/apps/talk.c index 2f15ebce49..0c3b769d82 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -354,14 +354,6 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize) logf("Incompatible voice file"); goto load_err; } - p_thumbnail = voicebuf.buf + file_size; - p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ - size_for_thumbnail = voicebuf.buf + bufsize - p_thumbnail; -#if CONFIG_CODEC == SWCODEC - size_for_thumbnail = MIN(size_for_thumbnail, MAX_THUMBNAIL_BUFSIZE); -#endif - if (size_for_thumbnail <= 0) - p_thumbnail = NULL; } else goto load_err; @@ -403,11 +395,26 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize) #ifdef TALK_PARTIAL_LOAD alloc_size += silence_len + QUEUE_SIZE; +#else + /* allocate for the entire file, TALK_PROGRESSIVE_LOAD doesn't + * load everything just yet */ + alloc_size = file_size; #endif + if (alloc_size > bufsize) goto load_err; return; + /* now move p_thumbnail behind the voice clip buffer */ + p_thumbnail = voicebuf.buf + alloc_size; + p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ + size_for_thumbnail = voicebuf.buf + bufsize - p_thumbnail; +#if CONFIG_CODEC == SWCODEC + size_for_thumbnail = MIN(size_for_thumbnail, MAX_THUMBNAIL_BUFSIZE); +#endif + if (size_for_thumbnail <= 0) + p_thumbnail = NULL; + load_err: p_voicefile = NULL; has_voicefile = false; /* don't try again */ |