From: Monty Date: Mon, 26 Apr 2010 08:05:07 +0000 (+0000) Subject: Try out a new seek bisect optimization in vorbisfile. X-Git-Tag: v1.3.3~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03a40b19bf7e5a284ddc0d7416b3068de8adae5a;p=platform%2Fupstream%2Flibvorbis.git Try out a new seek bisect optimization in vorbisfile. svn path=/trunk/vorbis/; revision=17176 --- diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index c2ef280..a3569c9 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -1427,13 +1427,14 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ bisect=begin + (ogg_int64_t)((double)(target-begintime)*(end-begin)/(endtime-begintime)) - CHUNKSIZE; - if(bisect<=begin) - bisect=begin+1; + if(bisect>begin+CHUNKSIZE){ + result=_seek_helper(vf,bisect); + if(result) goto seek_error; + }else{ + bisect=begin; + } } - result=_seek_helper(vf,bisect); - if(result) goto seek_error; - while(beginoffset); if(result==OV_EREAD) goto seek_error;