Commit ef2706e7 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry

Port r17177 from libvorbis.

r16328 (committed in Tremor as r17526) broke chaining by causing
 vorbis_synthesis_init() to fail on a second call.


git-svn-id: https://svn.xiph.org/trunk/Tremor@17531 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent cffec537
......@@ -161,16 +161,17 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
b->window[1]=_vorbis_window(0,ci->blocksizes[1]/2);
/* finish the codebooks */
if(!ci->fullbooks)
if(!ci->fullbooks){
ci->fullbooks=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
for(i=0;i<ci->books;i++){
if(ci->book_param[i]==NULL)
goto abort_books;
if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
goto abort_books;
/* decode codebooks are now standalone after init */
vorbis_staticbook_destroy(ci->book_param[i]);
ci->book_param[i]=NULL;
for(i=0;i<ci->books;i++){
if(ci->book_param[i]==NULL)
goto abort_books;
if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
goto abort_books;
/* decode codebooks are now standalone after init */
vorbis_staticbook_destroy(ci->book_param[i]);
ci->book_param[i]=NULL;
}
}
v->pcm_storage=ci->blocksizes[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment