From f733ec194fae40d518c1b6ff5775c65223e655b6 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Mon, 7 Sep 2009 19:39:51 +0000 Subject: 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 --- apps/codecs/libtremor/synthesis.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'apps/codecs/libtremor/synthesis.c') 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){ if(decodep && vi->channels<=CHANNELS){ vb->pcm = ipcm_vect; - /* alloc pcm passback storage */ + /* set pcm end point */ vb->pcmend=ci->blocksizes[vb->W]; - if (vd->iram_pcm_storage >= vb->pcmend) { - /* use statically allocated iram buffer */ - if(vd->reset_pcmb || vb->pcm[0]==NULL) - { - /* one-time initialisation at codec start - NOT for every block synthesis start - allows us to flip between buffers once initialised - by simply flipping pointers */ - for(i=0; ichannels; i++) - vb->pcm[i] = &vd->iram_pcm[i*vd->iram_pcm_storage]; - } - } else { - if(vd->reset_pcmb || vb->pcm[0]==NULL) - { - /* dynamic allocation (slower) */ - for(i=0;ichannels;i++) - vb->pcm[i]=(ogg_int32_t *)_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i])); - } + /* use statically allocated buffer */ + if(vd->reset_pcmb || vb->pcm[0]==NULL) + { + /* one-time initialisation at codec start + NOT for every block synthesis start + allows us to flip between buffers once initialised + by simply flipping pointers */ + for(i=0; ichannels; i++) + vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]]; } vd->reset_pcmb = false; -- cgit v1.2.3