[Vorbis-dev] packed ogss

Ralph Giles giles
Thu Jul 29 07:06:32 PDT 2004


On Thu, Jul 29, 2004 at 11:57:57AM +0100, Tony wrote:

> I have about 30+ OGG files that I have joined together, now the engine I am
> working on has its own file management and when I use the OV open_callbaks
> it spends a long time constantly seeking and reading in different sets of
> 8500 bytes inside the open_callbacks function, some time for as long as
> 20-30 seconds, I assume this is doing something to find out the information
> for each of the individual oggs inside the packed file, is there anyway to
> speed this process up, or not make It search for the info at all as I have
> all the offsets to each ogg stored in a separate file. Or if it is not
> searching for information can anybody shed any light on what its trying to
> do in all this time.

Yes, by default ov_open looks for all the chain boundaries so it can
caluculate the total length of the sequence. If you only ever play it
straight through, just have your seek callback always return -1; in that
case libvorbis file will treat it as a non-seekable stream and just
passively play the data it's given. If you do need the seek, the usual
work around is to use the information in your seek table to calculate
offsets in your seek callback so each segment looks like a separate
file, i.e. don't let it see the other segments from inside the ov_open()
call.

Hope that helps,
-r


More information about the Vorbis-dev mailing list