| Chris@1 | 1 <html> | 
| Chris@1 | 2 | 
| Chris@1 | 3 <head> | 
| Chris@1 | 4 <title>libogg - function - ogg_sync_pageout</title> | 
| Chris@1 | 5 <link rel=stylesheet href="style.css" type="text/css"> | 
| Chris@1 | 6 </head> | 
| Chris@1 | 7 | 
| Chris@1 | 8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff"> | 
| Chris@1 | 9 <table border=0 width=100%> | 
| Chris@1 | 10 <tr> | 
| Chris@1 | 11 <td><p class=tiny>libogg documentation</p></td> | 
| Chris@1 | 12 <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td> | 
| Chris@1 | 13 </tr> | 
| Chris@1 | 14 </table> | 
| Chris@1 | 15 | 
| Chris@1 | 16 <h1>ogg_sync_pageout</h1> | 
| Chris@1 | 17 | 
| Chris@1 | 18 <p><i>declared in "ogg/ogg.h";</i></p> | 
| Chris@1 | 19 | 
| Chris@1 | 20 <p>This function takes the data stored in the buffer of the <a href="ogg_sync_state.html">ogg_sync_state</a> struct and inserts them into an <a href="ogg_page.html">ogg_page</a>. | 
| Chris@1 | 21 | 
| Chris@1 | 22 <p>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 | 23 <p><b>Caution:</b>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 | 24 | 
| Chris@1 | 25 <br><br> | 
| Chris@1 | 26 <table border=0 color=black cellspacing=0 cellpadding=7> | 
| Chris@1 | 27 <tr bgcolor=#cccccc> | 
| Chris@1 | 28 	<td> | 
| Chris@1 | 29 <pre><b> | 
| Chris@1 | 30 int ogg_sync_pageout(<a href="ogg_sync_state.html">ogg_sync_state</a> *oy, <a href="ogg_page.html">ogg_page</a> *og); | 
| Chris@1 | 31 </b></pre> | 
| Chris@1 | 32 	</td> | 
| Chris@1 | 33 </tr> | 
| Chris@1 | 34 </table> | 
| Chris@1 | 35 | 
| Chris@1 | 36 <h3>Parameters</h3> | 
| Chris@1 | 37 <dl> | 
| Chris@1 | 38 <dt><i>oy</i></dt> | 
| Chris@1 | 39 <dd>Pointer to a previously declared <a href="ogg_sync_state.html">ogg_sync_state</a> struct.  Normally, the internal storage of this struct should be filled with newly read data and verified using <a href="ogg_sync_wrote.html">ogg_sync_wrote</a>.</dd> | 
| Chris@1 | 40 <dt><i>og</i></dt> | 
| Chris@1 | 41 <dd>Pointer to page struct filled by this function. | 
| Chris@1 | 42 </dl> | 
| Chris@1 | 43 | 
| Chris@1 | 44 | 
| Chris@1 | 45 <h3>Return Values</h3> | 
| Chris@1 | 46 <blockquote> | 
| Chris@1 | 47 <li>-1 returned if stream has not yet captured sync (bytes were skipped).</li> | 
| Chris@1 | 48 <li>0 returned if more data needed or an internal error occurred.</li> | 
| Chris@1 | 49 <li>1 indicated a page was synced and returned.</li> | 
| Chris@1 | 50 </blockquote> | 
| Chris@1 | 51 <p> | 
| Chris@1 | 52 | 
| Chris@1 | 53 <h3>Example Usage</h3> | 
| Chris@1 | 54 <pre> | 
| Chris@1 | 55 if (ogg_sync_pageout(&oy, &og) != 1) { | 
| Chris@1 | 56 	buffer = ogg_sync_buffer(&oy, 8192); | 
| Chris@1 | 57 	bytes = fread(buffer, 1, 8192, stdin); | 
| Chris@1 | 58 	ogg_sync_wrote(&oy, bytes); | 
| Chris@1 | 59 } | 
| Chris@1 | 60 </pre> | 
| Chris@1 | 61 | 
| Chris@1 | 62 <br><br> | 
| Chris@1 | 63 <hr noshade> | 
| Chris@1 | 64 <table border=0 width=100%> | 
| Chris@1 | 65 <tr valign=top> | 
| Chris@1 | 66 <td><p class=tiny>copyright © 2000-2011 Xiph.Org</p></td> | 
| Chris@1 | 67 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td> | 
| Chris@1 | 68 </tr><tr> | 
| Chris@1 | 69 <td><p class=tiny>libogg documentation</p></td> | 
| Chris@1 | 70 <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td> | 
| Chris@1 | 71 </tr> | 
| Chris@1 | 72 </table> | 
| Chris@1 | 73 | 
| Chris@1 | 74 | 
| Chris@1 | 75 </body> | 
| Chris@1 | 76 | 
| Chris@1 | 77 </html> |