summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-01-27 16:33:44 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-01-27 16:33:44 +0000
commit369b6bd367d96e0c4a13c1f8c14830091737e84f (patch)
tree86d257e14c449ee5ad266853fa506c31197eda7f
parentadc349891e03c6288f1434351b2cd640356580e3 (diff)
downloadrockbox-369b6bd367d96e0c4a13c1f8c14830091737e84f.tar.gz
rockbox-369b6bd367d96e0c4a13c1f8c14830091737e84f.zip
Fix a potential voice related bug with first time buffer setup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12125 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c
index c4f590c34f..ff681bb85c 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -3447,7 +3447,14 @@ static void audio_reset_buffer(size_t pcmbufsize)
#ifdef IRAM_STEAL
/* Allocate voice IRAM swap buffer once */
if (iram_buf[CODEC_IDX_VOICE] == NULL)
+ {
iram_buf[CODEC_IDX_VOICE] = buffer_alloc(CODEC_IRAM_SIZE);
+ /* buffer_alloc moves audiobuf; this is safe because only the end
+ * has been touched so far in this function and the address of
+ * filebuf + filebuflen is not changed */
+ filebuf += CODEC_IRAM_SIZE;
+ filebuflen -= CODEC_IRAM_SIZE;
+ }
dram_buf[CODEC_IDX_VOICE] = dram_buf[CODEC_IDX_AUDIO] + CODEC_SIZE;
#else
iram_buf[CODEC_IDX_VOICE] = dram_buf[CODEC_IDX_AUDIO] + CODEC_SIZE;