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 c9408314ac02dec07e183a186e4ff97c56663772..08a55f3db5f4ab53bfa04513f3d6673d1abea549 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;
       }