[Vorbis-dev] ogg_sync_pageout
Ralph Giles
giles at xiph.org
Wed Jun 22 07:55:32 PDT 2005
On Wed, Jun 22, 2005 at 09:32:52AM -0500, Christopher Egner wrote:
> It seems to me that running ogg_sync_pageout doesn't automatically advance
> the page. This is good if you haven't worked with the given page, makes
> coding somewhat easier. However, when does a page advance. Is it after a
> call to ogg_stream_pagein?
Can you elaborate on what you mean by 'advance the page'?
ogg_sync_pageout() fills out the pointers in the ogg_page struct to
reference data that's been passed in and marked with ogg_sync_wrote(). I
suppose conceptually in libogg ownership of that data passes with the
ogg_page struct to the caller, and then back into libogg only when you
call ogg_stream_pagein().
Is that what you mean? Another call to ogg_sync_pageout() could return
another page if there's more data buffered inside the ogg_sync struct.
> Would you also need to call ogg_sync_destroy, and pretty much start over? Or
> is there a way you can feed it new data without destroying the buffer?
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.
If you've passed a chain boundary you'll need to seek for the headers
and tear down and re-initialize your decoder if they're different, of
course.
FWIW,
-r
>
> Thanks a ton,
> Christopher
>
>
> _______________________________________________
> Vorbis-dev mailing list
> Vorbis-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/vorbis-dev
More information about the Vorbis-dev
mailing list