Chris@1: Chris@1: Chris@1: Chris@1: libogg - function - ogg_sync_pageout Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

libogg documentation

libogg release 1.3.0 - 20110804

Chris@1: Chris@1:

ogg_sync_pageout

Chris@1: Chris@1:

declared in "ogg/ogg.h";

Chris@1: Chris@1:

This function takes the data stored in the buffer of the ogg_sync_state struct and inserts them into an ogg_page. Chris@1: Chris@1:

In an actual decoding loop, this function should be called first to ensure that the buffer is cleared. The example code below illustrates a clean reading loop which will fill and output pages. Chris@1:

Caution:This function should be called before reading into the buffer to ensure that data does not remain in the ogg_sync_state struct. Failing to do so may result in a memory leak. See the example code below for details. Chris@1: Chris@1:

Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
Chris@1:

Chris@1: int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
Chris@1: 
Chris@1:
Chris@1: Chris@1:

Parameters

Chris@1:
Chris@1:
oy
Chris@1:
Pointer to a previously declared ogg_sync_state struct. Normally, the internal storage of this struct should be filled with newly read data and verified using ogg_sync_wrote.
Chris@1:
og
Chris@1:
Pointer to page struct filled by this function. Chris@1:
Chris@1: Chris@1: Chris@1:

Return Values

Chris@1:
Chris@1:
  • -1 returned if stream has not yet captured sync (bytes were skipped).
  • Chris@1:
  • 0 returned if more data needed or an internal error occurred.
  • Chris@1:
  • 1 indicated a page was synced and returned.
  • Chris@1:
    Chris@1:

    Chris@1: Chris@1:

    Example Usage

    Chris@1:
    Chris@1: if (ogg_sync_pageout(&oy, &og) != 1) {
    Chris@1: 	buffer = ogg_sync_buffer(&oy, 8192);
    Chris@1: 	bytes = fread(buffer, 1, 8192, stdin);
    Chris@1: 	ogg_sync_wrote(&oy, bytes);
    Chris@1: }
    Chris@1: 
    Chris@1: Chris@1:

    Chris@1:
    Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

    copyright © 2000-2011 Xiph.Org

    Ogg Container Format

    libogg documentation

    libogg release 1.3.0 - 20110804

    Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: