4 <title>libogg - function - ogg_stream_packetpeek
</title>
5 <link rel=stylesheet
href=
"style.css" type=
"text/css">
8 <body bgcolor=white text=black
link=
"#5555ff" alink=
"#5555ff" vlink=
"#5555ff">
9 <table border=
0 width=
100%
>
11 <td><p class=tiny
>libogg documentation
</p></td>
12 <td align=right
><p class=tiny
>libogg release
1.3.3 -
20171107</p></td>
16 <h1>ogg_stream_packetpeek
</h1>
18 <p><i>declared in
"ogg/ogg.h";
</i></p>
20 <p>This function attempts to assemble a raw data packet and returns
21 it without advancing decoding.
</p>
23 <p>In a typical situation, this would be called
24 speculatively after
<a
25 href=
"ogg_stream_pagein.html">ogg_stream_pagein()
</a> to check
26 the packet contents before handing it off to a codec for
27 decompression. To advance page decoding and remove
28 the packet from the sync structure, call
29 <a href=
"ogg_stream_packetout.html">ogg_stream_packetout()
</a>.
</p>
33 <table border=
0 color=black cellspacing=
0 cellpadding=
7>
37 int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
46 <dd>Pointer to a previously declared
47 <a href=
"ogg_stream_state.html">ogg_stream_state
</a> struct. Before this
48 function is called, an
<a href=
"ogg_page.html">ogg_page
</a> should be
49 submitted to the stream using
50 <a href=
"ogg_stream_pagein.html">ogg_stream_pagein()
</a>.
</dd>
52 <dd>Pointer to the next packet available in the bitstream, if
53 any. A NULL value may be passed in the case of a simple
"is there a
58 <h3>Return Values
</h3>
61 <li>-
1 if there's no packet available due to lost sync or a hole in the data.
</li>
62 <li>0 if there is insufficient data available to complete a packet, or on unrecoverable internal error occurred.
</li>
63 <li>1 if a packet is available.
</li>
72 <table border=
0 width=
100%
>
74 <td><p class=tiny
>copyright
© 2000-
2017 Xiph.Org Foundation
</p></td>
75 <td align=right
><p class=tiny
><a href=
"http://www.xiph.org/ogg/">Ogg Container Format
</a></p></td>
77 <td><p class=tiny
>libogg documentation
</p></td>
78 <td align=right
><p class=tiny
>libogg release
1.3.3 -
20171107</p></td>