summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/synthesis.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2009-09-07 19:39:51 +0000
committerMagnus Holmgren <magnushol@gmail.com>2009-09-07 19:39:51 +0000
commitf733ec194fae40d518c1b6ff5775c65223e655b6 (patch)
tree10692c023e15b6702db77c90923b961eb5f9526d /apps/codecs/libtremor/synthesis.c
parent649b50cba192e633876907c41d0e03aa75eef512 (diff)
downloadrockbox-f733ec194fae40d518c1b6ff5775c65223e655b6.tar.gz
rockbox-f733ec194fae40d518c1b6ff5775c65223e655b6.zip
Fix for FS#10492, by Aoyumi: Data abort errors when playing some Vorbis files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22653 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libtremor/synthesis.c')
-rw-r--r--apps/codecs/libtremor/synthesis.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/apps/codecs/libtremor/synthesis.c b/apps/codecs/libtremor/synthesis.c
index b1c5eeccef..a882a6d07a 100644
--- a/apps/codecs/libtremor/synthesis.c
+++ b/apps/codecs/libtremor/synthesis.c
@@ -70,26 +70,17 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){
70 if(decodep && vi->channels<=CHANNELS){ 70 if(decodep && vi->channels<=CHANNELS){
71 vb->pcm = ipcm_vect; 71 vb->pcm = ipcm_vect;
72 72
73 /* alloc pcm passback storage */ 73 /* set pcm end point */
74 vb->pcmend=ci->blocksizes[vb->W]; 74 vb->pcmend=ci->blocksizes[vb->W];
75 if (vd->iram_pcm_storage >= vb->pcmend) { 75 /* use statically allocated buffer */
76 /* use statically allocated iram buffer */ 76 if(vd->reset_pcmb || vb->pcm[0]==NULL)
77 if(vd->reset_pcmb || vb->pcm[0]==NULL) 77 {
78 { 78 /* one-time initialisation at codec start
79 /* one-time initialisation at codec start 79 NOT for every block synthesis start
80 NOT for every block synthesis start 80 allows us to flip between buffers once initialised
81 allows us to flip between buffers once initialised 81 by simply flipping pointers */
82 by simply flipping pointers */ 82 for(i=0; i<vi->channels; i++)
83 for(i=0; i<vi->channels; i++) 83 vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]];
84 vb->pcm[i] = &vd->iram_pcm[i*vd->iram_pcm_storage];
85 }
86 } else {
87 if(vd->reset_pcmb || vb->pcm[0]==NULL)
88 {
89 /* dynamic allocation (slower) */
90 for(i=0;i<vi->channels;i++)
91 vb->pcm[i]=(ogg_int32_t *)_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
92 }
93 } 84 }
94 vd->reset_pcmb = false; 85 vd->reset_pcmb = false;
95 86