mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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
This commit is contained in:
parent
adc349891e
commit
369b6bd367
1 changed files with 7 additions and 0 deletions
|
|
@ -3447,7 +3447,14 @@ static void audio_reset_buffer(size_t pcmbufsize)
|
||||||
#ifdef IRAM_STEAL
|
#ifdef IRAM_STEAL
|
||||||
/* Allocate voice IRAM swap buffer once */
|
/* Allocate voice IRAM swap buffer once */
|
||||||
if (iram_buf[CODEC_IDX_VOICE] == NULL)
|
if (iram_buf[CODEC_IDX_VOICE] == NULL)
|
||||||
|
{
|
||||||
iram_buf[CODEC_IDX_VOICE] = buffer_alloc(CODEC_IRAM_SIZE);
|
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;
|
dram_buf[CODEC_IDX_VOICE] = dram_buf[CODEC_IDX_AUDIO] + CODEC_SIZE;
|
||||||
#else
|
#else
|
||||||
iram_buf[CODEC_IDX_VOICE] = dram_buf[CODEC_IDX_AUDIO] + CODEC_SIZE;
|
iram_buf[CODEC_IDX_VOICE] = dram_buf[CODEC_IDX_AUDIO] + CODEC_SIZE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue