summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-08-22 09:56:58 +0000
committerThomas Martitz <kugel@rockbox.org>2011-08-22 09:56:58 +0000
commitb66d07a9e3a27af3a6b4d2cba8e7909b9beab46d (patch)
tree4f5a00e6a14c3f403205145db800d91acde15141
parentc3e5625a7f86f263ca894fb31e4ae3cd54f8f3d3 (diff)
downloadrockbox-b66d07a9e3a27af3a6b4d2cba8e7909b9beab46d.tar.gz
rockbox-b66d07a9e3a27af3a6b4d2cba8e7909b9beab46d.zip
Fix red on hwcodec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30338 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/talk.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/talk.c b/apps/talk.c
index ed7d55d455..2f15ebce49 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -77,6 +77,10 @@ const char* const file_thumbnail_ext = ".talk";
77 77
78#define LOADED_MASK 0x80000000 /* MSB */ 78#define LOADED_MASK 0x80000000 /* MSB */
79 79
80/* swcodec: cap p_thumnail to MAX_THUMNAIL_BUFSIZE since audio keeps playing
81 * while voice
82 * hwcodec: just use whatever is left in the audiobuffer, music
83 * playback is impossible => no cap */
80#if CONFIG_CODEC == SWCODEC 84#if CONFIG_CODEC == SWCODEC
81#define MAX_THUMBNAIL_BUFSIZE 0x10000 85#define MAX_THUMBNAIL_BUFSIZE 0x10000
82#endif 86#endif
@@ -352,8 +356,10 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize)
352 } 356 }
353 p_thumbnail = voicebuf.buf + file_size; 357 p_thumbnail = voicebuf.buf + file_size;
354 p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ 358 p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */
355 size_for_thumbnail = 359 size_for_thumbnail = voicebuf.buf + bufsize - p_thumbnail;
356 MIN(voicebuf.buf + bufsize - p_thumbnail, MAX_THUMBNAIL_BUFSIZE); 360#if CONFIG_CODEC == SWCODEC
361 size_for_thumbnail = MIN(size_for_thumbnail, MAX_THUMBNAIL_BUFSIZE);
362#endif
357 if (size_for_thumbnail <= 0) 363 if (size_for_thumbnail <= 0)
358 p_thumbnail = NULL; 364 p_thumbnail = NULL;
359 } 365 }
@@ -607,7 +613,9 @@ static void alloc_thumbnail_buf(void)
607{ 613{
608 /* use the audio buffer now, need to release before loading a voice */ 614 /* use the audio buffer now, need to release before loading a voice */
609 p_thumbnail = voicebuf; 615 p_thumbnail = voicebuf;
616#if CONFIG_CODEC == SWCODEC
610 size_for_thumbnail = MAX_THUMBNAIL_BUFSIZE; 617 size_for_thumbnail = MAX_THUMBNAIL_BUFSIZE;
618#endif
611 thumbnail_buf_used = 0; 619 thumbnail_buf_used = 0;
612} 620}
613 621