Patch for "seek broken for large files and on pure 32 bit architectures"
authorMonty <xiphmont@xiph.org>
Wed, 8 Apr 2009 00:53:57 +0000 (00:53 +0000)
committerMonty <xiphmont@xiph.org>
Wed, 8 Apr 2009 00:53:57 +0000 (00:53 +0000)
svn path=/trunk/vorbis/; revision=15921

lib/vorbisfile.c

index c940831..08a55f3 100644 (file)
@@ -1324,8 +1324,9 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
        bisect=begin;
       }else{
        /* take a (pretty decent) guess. */
-       bisect=begin + 
-         (target-begintime)*(end-begin)/(endtime-begintime) - CHUNKSIZE;
+       bisect=begin +
+         (ogg_int64_t)((double)(target-begintime)*(end-begin)/(endtime-begintime))
+         - CHUNKSIZE;
        if(bisect<=begin)
          bisect=begin+1;
       }