[vorbis-dev] Howto use ogg_page_granulepos for exact playback position?

Tibor Kiss tkiss at mavip.hu
Tue Apr 16 09:33:18 PDT 2002



I have the following problem.
Be an encoder application (station) and a decoder application (receiver).
If I feed the vorbis encoder with 'n' pcm samples in the station I want to
know how many pcm samples will be decoded in the receiver if I feed the
decoder with the encoded output. The ogg_page_granulepos is right for the
purpose?

I read the documentation about the ogg_page_granulepos function. There is
the following:
"Returns the exact granular position of the packet data contained at the end
of this page.
This is useful for tracking location when seeking or decoding.
For example, in audio codecs this position is the pcm sample number and in
video this is the frame number."

I don't understand the meaning of 'exact granular position of the packet
data contained at the end of this page'.

While I feed the encoder and no page boundary were found between two feeding
cycles (there is no effective encoded output), the ogg_page_granulepos is
increasing continuously. How I understand ogg_page_granulepos is not the
right function for me.

Does anybody know the solution ?

Tibor

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list