[Vorbis-dev] ogg_sync_pageout

Ralph Giles giles at xiph.org
Wed Jun 22 09:03:18 PDT 2005


On Wed, Jun 22, 2005 at 10:39:02AM -0500, Christopher Egner wrote:

> Like I said, I THOUGHT there was a problem, but it didn't make sense that
> such a simple example would be flawed for so long without anyone noticing
> (the amount of pcm data would be negligible, but still it doesn't seem
> right). So I ran some tests on ogg_sync_pageout. You can run it a million
> times, and it returns the same ptrs. I assume that you have to make a call
> to ogg_stream_pagein for ogg_sync_pageout to scan to the next page. Perhaps
> something was wrong in my test though.

Are you checking the return value of ogg_sync_pageout? If there are no 
new, complete pages available it will return 0 indicating "need more 
data" and not update the passed ogg_page structure at all. So maybe
it's not returning the same page again and again, it just returns it 
once and then you're printing the same values over and over again?

> > You don't need to call ogg_sync_destroy, you can just start feeding it
> > data from the seek point and it will find the next page boundary and
> > continue handing you new pages from there.
> 
> Is this after a call to ogg_sync_reset?

yes, that tells it to discard any unused data.

> So as long as I have stream serial numbers, I don't need to concern myself
> with any changes to the vorbis stuff at all? Or do I still need a
> vorbis_synthesis_reset to get rid of old left hand window data?

I suspect so. Vorbis overlaps successive audio packets to reduce 
blocking artefacts, so you have to signal the decoder that there will be 
a discontinuity to avoid getting some noise. Best to have a look at what 
vorbisfile does.

Glad to be helpful,
 -r


More information about the Vorbis-dev mailing list