Anders Thomsen
2002-Nov-06 08:35 UTC
[vorbis-dev] Confusion with page_segments / segment_table
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. I've looked at some files that has a Comment tag so large, that it is spread over two pages. Here, the first Page Header (not the first Page Header in the entire file, but the one just before the comment tag starts) has this extra trailing segment. But the next Page Header (which is positioned in the middle of the comment tag) only has as many segments as specified in the Page Segments byte value. It does not have a trailing segment. What am I missing here? Thanks in advantage, Anders Thomsen --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Anders Thomsen
2002-Nov-11 07:50 UTC
[vorbis-dev] Confusion with page_segments / segment_table
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. I've looked at some files that has a Comment tag so large, that it is spread over two pages. Here, the first Page Header (not the first Page Header in the entire file, but the one just before the comment tag starts) has this extra trailing segment. But the next Page Header (which is positioned in the middle of the comment tag) only has as many segments as specified in the Page Segments byte value. It does not have a trailing segment. What am I missing here? Thanks in advantage, Anders Thomsen --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Tor-Einar Jarnbjo
2002-Nov-11 08:50 UTC
[vorbis-dev] Confusion with page_segments / segment_table
Mandag, 11 november 2002, skrev du:>What am I missing here?I am not sure if I understand your question, but an ogg packet (which is based on any number of segments with length 255 followed by a segment with a length < 255) can span page boundaries. There is a restriction in the Vorbis specification, that the first and third header packets (identification and setup) have to end on a page boundary, but the second header (the comment header) does not have to do so. <p>Tor -- Tor-Einar Jarnbjo IT Consultant, Itera Grosch & Link AG Tel.: (0170) 222 54 38 <p><p><p><p>==================================================================EASY and FREE access to your email anywhere: http://Mailreader.com/ ================================================================== <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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Wed, Nov 06, 2002 at 05:35:56PM +0100, Anders Thomsen wrote:> 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.No. The segment table is exactly as many bytes as are specified in segment_table. It can end with a byte of 255.> I've looked at some files that has a Comment tag so large, that itis spread over two pages. Yes. Overflow is more likely due to the setup (third) packet than the comment packet, but it is certainly possible in the comment.> Here, the first Page Header (not the firstPage Header in the entire file, but the one just before the comment tag starts) has this extra trailing segment. I don;t think you're seeing what you think you're seeing.> But the next Page Header (which is positioned in the middle of the comment tag) only has as many segments as specified in the Page Segments byte value. It does not have a trailing segment. > > What am I missing here?Look more closely at the structure. Don't fall into the trap of thinking that pages and packets are really all that closely related; pages are just a synchronization structure. They don't really 'contain' packets, just provide enough information to verify packets and mark boundaries. I expect what you're really seeing is third packet, which usually begins on second page, being split between second and third page. Monty --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.