[Vorbis] Stream "Saving" and Excerpting...
giles at xiph.org
Wed Sep 28 09:42:57 PDT 2005
On Wed, Sep 28, 2005 at 09:15:55AM -0400, Jason M. Sullivan wrote:
> The headers are there, but the serial number is 0, and the granule position
> is 0, leaving a big gap between the header, and the first granule (which
> has been counting since I started the encoder). The saver doesn't renumber
> the granules. Since I don't use the chunks directly, I might not even need
> a header, but that might require special fiddling to get working.
Ok, the serial number being zero is definitely a bug. It must match the
serial number of the data pages you want to use them with so the decoder
knows they go together.
Headers having a granule of zero is normal, and encoders should handle
the gap to the start of the actual data fine; that's how icecast streams
look when you connect.
If all of this is one big stream with no chain boundaries, you only need
one set of headers and the beginning. Having extra sets should work, but
my confuse seeking if you don't change the serial number for each
section (header + following data up to the next header). According to
spec the serial numbers have to be unique within the file you send.
Put more generally, if you're about to insert headers that are
identical to the previous set, you can just skip them, and append
the new data, making sure the serial numbers match.
More information about the Vorbis