[ogg-dev] Multi-track Seeking with oggz

Bob Ingraham bobi at ingrahams.us
Thu Sep 5 17:02:51 PDT 2013

Hopefully, this is the correct list for liboggz questions - if not please
let me know.

If I have multiple logical streams in an ogg file, and I invoke the
oggz_seek_units() function, how does it know on which logical stream to
seek? Or does it matter?

For example, assume:

1. I've opened an ogg file with the correct flags: OGGZ_READ | OGGZ_AUTO

2. My ogg file contains 4 logical streams.

3. Each logical stream is identical in terms of codec (Speex), sample-rate
(44.1kHz), sample-size, frame-size, single channel (mono), etc. Except
each stream has unique audio data. (e.g., concurrently recording from four

4. I've setup a unique read call back function for each of the 4 logical
streams (based upon logical stream serial number.)

Now I've read, say 120 seconds, into the file, and then I say:

     oggz_seek_units(oggz, 10000, SEEK_SET);

intending to seek to the point representing 10 seconds from the beginning
of the file.


Where do I actually end-up WRT to all four logical streams?

Are each of my logical stream read callbacks going to start receiving data
at the 10 second mark from each of their respective logical streams?
(Which would be my dream realized.)

The reasons that I ask are:

1. There is no mechanism within oggz (that I've seen,) to specify which
logical stream (serialno) you want to seek on, so:

2. I'm guessing that I end-up repositioned at the earliest matching time
offset within the ogg stream? (Regardless of which logical stream it is
associated with?)

2. I've experimented with the above scenario but don't think that I
actually end-up where I expect to.

So, perhaps my expectations and understanding of how it is supposed to
work are wrong.

Any enlightenment would be most appreciated.


More information about the ogg-dev mailing list