[vorbis-dev] Confusion with page_segments / segment_table

Michael Smith msmith at xiph.org
Tue Nov 12 01:02:49 PST 2002



At 04:50 PM 11/11/2002 +0100, you wrote:
>   Hi,   There is something I don't understand about the  page_segment and
>segment_table values in the documentation.   As I understand it, the
>segment table consist of as  many bytes as specified in page_segment, PLUS
>one trailing byte with a value  between 0 and 254. 

Not quite. The segment table has (always) exactly as many bytes as
specified by page_segments (so, between 0 and 255 bytes). You shouldn't
ever add one to that (otherwise, you're reading actual packet data, rather
than page headers).

Each _packet_ is specified by one or more segment table entries, possibly
over multiple pages, with the last one being between 0 and 254, and all
others being 255. 

So, in the case you're talking about, where there's a packet spanning
pages, the packet doesn't terminate on the first page, so there's no
'short' segment table entry - you only get that on the page where the
header ends. So the first page of the comment header has 255 for all
of the members of the segment table.

Michael

p.s. Please don't ever send HTML mail.

<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