From: Jack Moffitt Date: Tue, 18 Dec 2001 22:02:25 +0000 (+0000) Subject: ov_read_float() was calling vorbis_synthesis_read() and moving pointers X-Git-Tag: v1.3.3~861 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd31f32e9044d4c5fcaa12fe19eb924641397812;p=platform%2Fupstream%2Flibvorbis.git ov_read_float() was calling vorbis_synthesis_read() and moving pointers before we had processed the buffer. Instead of relying on ov_read_float to process our data before we pack it into integer types, we reimplement the small loop that it uses without the parts calling vorbis_synthesis_read. svn path=/trunk/vorbis/; revision=2658 --- diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index 42d8a27..6eb5cac 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -11,7 +11,7 @@ ******************************************************************** function: stdio-based convenience library for opening/seeking/decoding - last mod: $Id: vorbisfile.c,v 1.53 2001/12/14 00:30:33 jack Exp $ + last mod: $Id: vorbisfile.c,v 1.54 2001/12/18 22:02:25 jack Exp $ ********************************************************************/ @@ -1407,7 +1407,25 @@ long ov_read(OggVorbis_File *vf,char *buffer,int length, int host_endian = host_is_big_endian(); float **pcm; - long samples=ov_read_float(vf,&pcm,bitstream); + long samples; + + if(vf->ready_stateready_state>=STREAMSET){ + samples=vorbis_synthesis_pcmout(&vf->vd,&pcm); + if(samples)break; + } + + /* suck in another packet */ + { + int ret=_process_packet(vf,1); + if(ret==OV_EOF)return(0); + if(ret<=0)return(ret); + } + + } + if(samples>0){ /* yay! proceed to pack data into the byte buffer */