[Vorbis] Question About syncing

Ralph Giles giles at xiph.org
Tue May 12 09:16:08 PDT 2009


On Tue, May 12, 2009 at 10:02 AM, devel <engineering at wwrn.net> wrote:

>  What exactly does it mean when, in the decoder_example.c file, you try to
> extract the information from the comments and codebook headers and you loose
> sync? What is actually being check to determine when sync is lost?. I known
> one part of it is that there is a gaps in the stream. Is the CRC value  the
> determining factor? Please detail! I read a lot of the documents. I still am a
> little fuzzy.

"Losing sync" in the context of the vorbis code usually means
synchronization between the libogg read position and the beginning of
the next Ogg page in the stream. This is verified two ways: presence
of the 'OggS' magic sequence at the current read position, correct CRC
value for the subsequent page data. Normally, there will be a page
right where the code expects it to be. If the 'OggS' or CRC check
fail, then the file is corrupt, and it tries to find a place where
decoding can begin again by searching forward for the next 'OggS'
marking a new page and they trying the CRC from that point. When that
happens, the reader is said to have "regained sync" after "hole in
data".

HTH,
 -r


More information about the Vorbis mailing list