AW: [vorbis-dev] Confusion with page_segments / segment_table

Tor-Einar Jarnbjo Tor-Einar_Jarnbjo at grosch-link.de
Mon Nov 11 14:15:22 PST 2002



> Where is that specified in the documentation, I can't seem to find it
> anywhere?

http://www.xiph.org/ogg/vorbis/doc/framing.html

> My problem is, that I'm trying to read the comment. The first header just
> before the
> tag has the extra segment (< 255), but if the comment is spanned over, let
> say 2 pages,
> the next header does not have this extra segment. Is this always the case,
> that the first
> header has it, and the all following has not? If not, how do I determine
> wether it has this extra segment.

An Ogg file is, as you have recognized, divided in pages and segments, but
what you are interested in are packets. Packets are build of any number of
segments with the length 255 bytes, followed with a segment with a length
less than 255 and they may span page boundaries (with the exception of the
vorbis identification and setup headers, which have to end on a page
boundary).

For example, a Vorbis stream may begin like this:

Ogg page  |  Segment length  | Vorbis packet

   1               30                I

   2              255                C
   2              255                C
   2              255                C
   2              255                C
   2              255                C

   3              255                C
   3              255                C
   3              215                C
   3              255                S
   3              255                S
   3              255                S
   3              235                S

I = identification header
C = comment header
S = setup header

In the second Ogg page, the last segment has a length of 255 bytes, which
means, that the current packet continues on the next page.

I hope that this explanation made sense.

<p>Tor

--- >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