Fix ov_time_tell bug for non-seekable streams
authorMonty <xiphmont@xiph.org>
Fri, 11 Oct 2002 08:22:18 +0000 (08:22 +0000)
committerMonty <xiphmont@xiph.org>
Fri, 11 Oct 2002 08:22:18 +0000 (08:22 +0000)
svn path=/trunk/vorbis/; revision=3994

lib/floor1.c
lib/vorbisfile.c

index 338d02e..be0553b 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: floor backend 1 implementation
- last mod: $Id: floor1.c,v 1.24 2002/07/18 01:41:59 xiphmont Exp $
+ last mod: $Id: floor1.c,v 1.25 2002/10/11 08:22:18 xiphmont Exp $
 
  ********************************************************************/
 
@@ -663,6 +663,10 @@ int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
          int ly=post_Y(fit_valueA,fit_valueB,ln);
          int hy=post_Y(fit_valueA,fit_valueB,hn);
          
+         if(ly==-1 || hy==-1){
+           exit(1);
+         }
+
          if(inspect_error(lx,hx,ly,hy,logmask,logmdct,info)){
            /* outside error bounds/begin search area.  Split it. */
            int ly0=-200;
index fa52840..04703e7 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.62 2002/07/06 04:20:03 msmith Exp $
+ last mod: $Id: vorbisfile.c,v 1.63 2002/10/11 08:22:18 xiphmont Exp $
 
  ********************************************************************/
 
@@ -1341,9 +1341,7 @@ ogg_int64_t ov_pcm_tell(OggVorbis_File *vf){
 
 /* return time offset (seconds) of next PCM sample to be read */
 double ov_time_tell(OggVorbis_File *vf){
-  /* translate time to PCM position and call ov_pcm_seek */
-
-  int link=-1;
+  int link=0;
   ogg_int64_t pcm_total=0;
   double time_total=0.f;