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

Monty xiphmont at xiph.org
Wed Feb 27 23:12:21 PST 2002



xiphmont    02/02/27 23:12:20

  Modified:    lib      vorbisfile.c
  Log:
  fix one more beginning of stream braino; chained files pass seeking
  test now as well.

Revision  Changes    Path
1.57      +8 -3      vorbis/lib/vorbisfile.c

Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- vorbisfile.c	2002/02/28 04:12:48	1.56
+++ vorbisfile.c	2002/02/28 07:12:20	1.57
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.56 2002/02/28 04:12:48 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.57 2002/02/28 07:12:20 xiphmont Exp $
 
  ********************************************************************/
 
@@ -136,6 +136,7 @@
 /* returns offset or OV_EREAD, OV_FAULT */
 static long _get_prev_page(OggVorbis_File *vf,ogg_page *og){
   long begin=vf->offset;
+  long end=begin;
   long ret;
   int offset=-1;
 
@@ -144,8 +145,8 @@
     if(begin<0)
       begin=0;
     _seek_helper(vf,begin);
-    while(vf->offset<begin+CHUNKSIZE){
-      ret=_get_next_page(vf,og,begin+CHUNKSIZE-vf->offset);
+    while(vf->offset<end){
+      ret=_get_next_page(vf,og,end-vf->offset);
       if(ret==OV_EREAD)return(OV_EREAD);
       if(ret<0){
         break;
@@ -1092,6 +1093,10 @@
              preceeding page. Keep fetching previous pages until we
              get one with a granulepos or without the 'continued' flag
              set.  Then just use raw_seek for simplicity. */
+
+	  _decode_clear(vf);  
+	  _seek_helper(vf,best);
+
           while(1){
             ret=_get_prev_page(vf,&og);
             if(ret<0)goto seek_error;

<p><p><p>--- >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