forked from len0rd/rockbox
Fix red on hwcodec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30338 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c3e5625a7f
commit
b66d07a9e3
1 changed files with 10 additions and 2 deletions
12
apps/talk.c
12
apps/talk.c
|
|
@ -77,6 +77,10 @@ const char* const file_thumbnail_ext = ".talk";
|
||||||
|
|
||||||
#define LOADED_MASK 0x80000000 /* MSB */
|
#define LOADED_MASK 0x80000000 /* MSB */
|
||||||
|
|
||||||
|
/* swcodec: cap p_thumnail to MAX_THUMNAIL_BUFSIZE since audio keeps playing
|
||||||
|
* while voice
|
||||||
|
* hwcodec: just use whatever is left in the audiobuffer, music
|
||||||
|
* playback is impossible => no cap */
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
#define MAX_THUMBNAIL_BUFSIZE 0x10000
|
#define MAX_THUMBNAIL_BUFSIZE 0x10000
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -352,8 +356,10 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize)
|
||||||
}
|
}
|
||||||
p_thumbnail = voicebuf.buf + file_size;
|
p_thumbnail = voicebuf.buf + file_size;
|
||||||
p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */
|
p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */
|
||||||
size_for_thumbnail =
|
size_for_thumbnail = voicebuf.buf + bufsize - p_thumbnail;
|
||||||
MIN(voicebuf.buf + bufsize - p_thumbnail, MAX_THUMBNAIL_BUFSIZE);
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
size_for_thumbnail = MIN(size_for_thumbnail, MAX_THUMBNAIL_BUFSIZE);
|
||||||
|
#endif
|
||||||
if (size_for_thumbnail <= 0)
|
if (size_for_thumbnail <= 0)
|
||||||
p_thumbnail = NULL;
|
p_thumbnail = NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -607,7 +613,9 @@ static void alloc_thumbnail_buf(void)
|
||||||
{
|
{
|
||||||
/* use the audio buffer now, need to release before loading a voice */
|
/* use the audio buffer now, need to release before loading a voice */
|
||||||
p_thumbnail = voicebuf;
|
p_thumbnail = voicebuf;
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
size_for_thumbnail = MAX_THUMBNAIL_BUFSIZE;
|
size_for_thumbnail = MAX_THUMBNAIL_BUFSIZE;
|
||||||
|
#endif
|
||||||
thumbnail_buf_used = 0;
|
thumbnail_buf_used = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue