[ogg-dev] Problems seeking with liboggz

Julio Cesar Esteves Cabezas
Wed, 16 May 2012 22:52:15 -0000

Hi,



  I intend to use Ogg+Speex for voice recording/playback in a VoIP app.

  I am experimenting with liboggz to get acquainted with its API.

  As test files I am using some Ogg-Speex files converted from WAV files
with speexenc.exe.



  I wrote a little testing app in Visual Studio 2010 under Windows 7.

  I defined OggzReadPage and OggzReadPacket callbacks with
oggz_set_read_page() and oggz_set_read_callback().



  For the moment I am mainly having troubles with seeking. Maybe I am not
using correctly liboggz API.

  What happens:

  - I open a Ogg Speex-encoded audio file with oggz_open("MyFile.spx",
OGGZ_READ | OGGZ_AUTO);

  - I have a loop of invocations of oggz_read() that triggers in the due
time the page and packet callbacks defined by me.

  - But when I randomly do seeking by means of

      ogg_int64_t rseek = oggz_seek_units(pOGGZ, posMsecs, SEEK_SET);

    I get erratic results:

      Many times rseek does not match posMsecs.

      The first page callback after the seek invocation refers to a page
that is sometimes previous and sometimes after the page that contains
posMsecs.





  What rules are to be followed for seeking with liboggz and what exact
results can be expected from it ?





Thanks in advance

Julio Cabezas





-------------- next part --------------
An HTML attachment was scrubbed...