<p>This example takes its input on stdin which is in 'text' mode by default under Windows; this will corrupt the input data unless set to binary mode. This applies only to Windows.
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
</b></pre>
</td>
</tr>
</table>
<p>
First we check to make sure the stream is seekable using <ahref="ov_seekable.html">ov_seekable</a>.
<p>Then we're going to find the number of logical bitstreams in the physical bitstream using <ahref="ov_streams.html">ov_streams</a>.
<p>We use <ahref="ov_time_total.html">ov_time_total</a> to determine the total length of the physical bitstream. We specify that we want the entire bitstream by using the argument <tt>-1</tt>.
printf("Total bitstream playing time: %ld seconds\n\n",
(long)ov_time_total(&ov,-1));
}else{
printf("Standard input was not seekable.\n"
"First logical bitstream information:\n\n");
}
</b></pre>
</td>
</tr>
</table>
<p>Now we're going to iterate through each logical bitstream and print information about that bitstream.
<p>We use <ahref="ov_info.html">ov_info</a> to pull out the <ahref="../libvorbis/vorbis_info.html">vorbis_info</a> struct for each logical bitstream. This struct contains bitstream-specific info.
<p><ahref="ov_serialnumber.html">ov_serialnumber</a> retrieves the unique serial number for the logical bistream. <ahref="ov_raw_total.html">ov_raw_total</a> gives the total compressed bytes for the logical bitstream, and <ahref="ov_time_total.html">ov_time_total</a> gives the total time in the logical bitstream.