Why no Vorbis 2-pass?
Reply #37 – 2003-01-31 10:28:20
Yes, but are they REALLY incorrect? I'll check OGG and Vorbis specs and see if this padding is needed or only 'recommended' or 'might be implemented'. If it's the second case, then decoder is wrong. The only wrong call is eof() function, which seems to be used by seek() <edit> From Ogg Vorbis I format specification: bitpacking conventionend-of-packet alignment The typical use of bitpacking is to produce many independent byte-aligned packets which are embedded into a larger byte-aligned container structure, such as an Ogg transport bitstream. Externally, each bytestream (encoded bitstream) must begin and end on a byte boundary. Often, the encoded bitstream is not an integer number of bytes, and so there is unused (uncoded) space in the last byte of a packet. Unused space in the last byte of a bytestream is always zeroed during the coding process. Thus, should this unused space be read, it will return binary zeroes. Attempting to read past the end of an encoded packet results in an 'end-of-packet' condition. End-of-packet is not to be considered an error; it is merely a state indicating that there is insufficient remaining data to fulfill the desired read size. Vorbis uses truncated packets as a normal mode of operation, and as such, decoders must handle reading past the end of a packet as a typical mode of operation. Any further read operations after an 'end-of-packet' condition shall also return 'end-of-packet'. This is what's probably wrong... the data to skip is rehuffed and zeroes are compressed. Remuxing restores them. That's why the filesize was different by few bytes. Decoder (libvorbis) tries to read it and returns end-of-packet. Winamp handles it correctly (skips), foobar starts to consume 100% CPU... but after a LONG while it begins to play another file! It's a bug in foobar, not libvorbis!!! Nonetheless this data should be restored after rehuffing, it should be quite easy to do. Just fill the end of the last packet with zeroes where needed after rehuffing. </edit>
I've changed only because of myself. Remember, when you quote me, you're quoting AstralStorm. (read: this account is dead)