[xiph-cvs] cvs commit: vorbis/lib vorbisfile.c

Jack Moffitt jack at xiph.org
Tue Dec 18 14:02:27 PST 2001



jack        01/12/18 14:02:26

  Modified:    lib      vorbisfile.c
  Log:
  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.

Revision  Changes    Path
1.54      +20 -2     vorbis/lib/vorbisfile.c

Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- vorbisfile.c	2001/12/14 00:30:33	1.53
+++ vorbisfile.c	2001/12/18 22:02:25	1.54
@@ -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 @@
   int host_endian = host_is_big_endian();
 
   float **pcm;
-  long samples=ov_read_float(vf,&pcm,bitstream);
+  long samples;
+
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+
+  while(1){
+    if(vf->ready_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 */

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list