Commit 63bb426c authored by Segher Boessenkool's avatar Segher Boessenkool
Browse files

several extremely minor fixes

svn path=/trunk/vorbis/; revision=2868
parent 944ed8b3
......@@ -14,9 +14,9 @@
</table>
<h1>Libvorbisenc API Overview</h1>
<p>The current version of libvorbisenc is very simple. It contains an initialization function to set up the encoding engine properly.
It also contains a control function to be used in the future to tweak encoder settings.
<p>The current version of libvorbisenc is very simple. It contains an initialization function to set up the encoding engine properly.
It also contains a control function to be used in the future to tweak encoder settings.
<p>
All the <b>libvorbisenc</b> routines are declared in "vorbis/vorbisenc.h".
......@@ -29,7 +29,7 @@ All the <b>libvorbisenc</b> routines are declared in "vorbis/vorbisenc.h".
<tr valign=top>
<td><a href="vorbis_encode_init.html">vorbis_encode_init</a></td>
<td>This function takes a <a href="vorbis_info.html">vorbis_info</a> struct and encoding parameters and sets up a proper encoding environment.</tt></a>.</td>
</tr>
</tr>
<tr valign=top>
<td><a href="vorbis_encode_init_vbr.html">vorbis_encode_init_vbr</a></td>
<td>This function takes a <a href="vorbis_info.html">vorbis_info</a> struct
......
BODY { font-family: helvetica, sans-serif }
TD { font-family: helvetica, sans-serif }
P { font-family: helvetica, sans-serif }
H1 { font-family: helvetica, sans-serif }
H2 { font-family: helvetica, sans-serif }
H4 { font-family: helvetica, sans-serif }
BODY { font-family: Helvetica, sans-serif }
TD { font-family: Helvetica, sans-serif }
P { font-family: Helvetica, sans-serif }
H1 { font-family: Helvetica, sans-serif }
H2 { font-family: Helvetica, sans-serif }
H4 { font-family: Helvetica, sans-serif }
P.tiny { font-size: 8pt }
......@@ -25,7 +25,7 @@
<tr bgcolor=#cccccc>
<td>
<pre><b>
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
</b></pre>
</td>
......@@ -35,17 +35,17 @@ extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
<h3>Parameters</h3>
<dl>
<dt><i>vi</i></dt>
<dd>File pointer to an initialized <a href="vorbis_info.html">vorbis_info</a> struct.</dd>
<dt><i>number</i></dt>
<dd>Not yet implemented.</dd>
<dt><i>arg</i></dt>
<dd>File pointer to an initialized <a href="vorbis_info.html">vorbis_info</a> struct.</dd>
<dt><i>number</i></dt>
<dd>Not yet implemented.</dd>
<dt><i>arg</i></dt>
<dd>Not yet implemented.</dd>
<h3>Return Values</h3>
<blockquote>
<li>
<li>OV_EIMPL is always returned, as this function has not yet been implemented.</li>
<li>
<li>OV_EIMPL is always returned, as this function has not yet been implemented.</li>
</blockquote>
<p>
......
......@@ -17,7 +17,7 @@
<p><i>declared in "vorbis/libvorbisenc.h";</i></p>
<p>This is the primary function within libvorbisenc. This is used to properly set up an encoding environment using libvorbisenc.
<p>This is the primary function within libvorbisenc. This is used to properly set up an encoding environment using libvorbisenc.
<p>Before this function is called, the <a href="vorbis_info.html">vorbis_info</a> struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear should be called.
<p>The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set constraints for the encoded file. This function uses these settings to select the appropriate encoding mode and set it up.
<p>
......@@ -26,13 +26,13 @@
<tr bgcolor=#cccccc>
<td>
<pre><b>
extern int vorbis_encode_init(<a href="vorbis_info.html">vorbis_info</a> *vi,
long channels,
long rate,
long max_bitrate,
long nominal_bitrate,
long min_bitrate);
extern int vorbis_encode_init(<a href="vorbis_info.html">vorbis_info</a> *vi,
long channels,
long rate,
long max_bitrate,
long nominal_bitrate,
long min_bitrate);
</b></pre>
</td>
......@@ -48,9 +48,9 @@ extern int vorbis_encode_init(<a href="vorbis_info.html">vorbis_info</a> *vi,
<dt><i>rate</i></dt>
<dd>The sampling rate of the source audio.</dd>
<dt><i>max_bitrate</i></dt>
<dd>Desired maximum bitrate (limit).</dd>
<dd>Desired maximum bitrate (limit).</dd>
<dt><i>nominal_bitrate</i></dt>
<dd>Desired average, or central, bitrate.</dd>
<dd>Desired average, or central, bitrate.</dd>
<dt><i>min_bitrate</i></dt>
<dd>Desired minimum bitrate.</dd>
</dl>
......@@ -61,10 +61,10 @@ extern int vorbis_encode_init(<a href="vorbis_info.html">vorbis_info</a> *vi,
<li>
0 for success</li>
<li>less than zero for failure:</li>
<ul>
<li>less than zero for failure:</li>
<ul>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</ul>
</blockquote>
<p>
......
......@@ -17,7 +17,7 @@
<p><i>declared in "vorbis/libvorbisenc.h";</i></p>
<p>This is the primary function within libvorbisenc. This is used to properly set up an encoding environment using libvorbisenc.
<p>This is the primary function within libvorbisenc. This is used to properly set up an encoding environment using libvorbisenc.
<p>Before this function is called, the <a href="vorbis_info.html">vorbis_info</a> struct should be initialized by using vorbis_info_init() from the libvorbis API. After encoding, vorbis_info_clear should be called.
<p>The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set constraints for the encoded file. This function uses these settings to select the appropriate encoding mode and set it up.
<p>
......@@ -26,11 +26,11 @@
<tr bgcolor=#cccccc>
<td>
<pre><b>
extern int vorbis_encode_init_vbr(<a href="vorbis_info.html">vorbis_info</a> *vi,
long channels,
long rate,
float base_quality /* from 0. (lo) to 1. (hi) */);
extern int vorbis_encode_init_vbr(<a href="vorbis_info.html">vorbis_info</a> *vi,
long channels,
long rate,
float base_quality /* from 0. (lo) to 1. (hi) */);
</b></pre>
</td>
......@@ -55,10 +55,10 @@ extern int vorbis_encode_init_vbr(<a href="vorbis_info.html">vorbis_info</a> *vi
<li>
0 for success</li>
<li>less than zero for failure:</li>
<ul>
<li>less than zero for failure:</li>
<ul>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</ul>
</blockquote>
<p>
......
......@@ -24,44 +24,44 @@ The example program source:
<td>
<pre><b>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
int main(){
OggVorbis_File ov;
int i;
/* open the file/pipe on stdin */
if(ov_open(stdin,&ov,NULL,-1)<0){
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
/* print details about each logical bitstream in the input */
if(ov_seekable(&ov)){
printf("Input bitstream contained %ld logical bitstream section(s).\n",
ov_streams(&ov));
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");
}
for(i=0;i<ov_streams(&ov);i++){
vorbis_info *vi=ov_info(&ov,i);
printf("\tlogical bitstream section %d information:\n",i+1);
printf("\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n",
vi->rate,vi->channels,ov_bitrate(&ov,i)/1000,
ov_serialnumber(&ov,i));
printf("\t\tcompressed length: %ld bytes ",(long)(ov_raw_total(&ov,i)));
printf(" play time: %lds\n",(long)ov_time_total(&ov,i));
}
ov_clear(&ov);
return 0;
}
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
int main(){
OggVorbis_File ov;
int i;
/* open the file/pipe on stdin */
if(ov_open(stdin,&ov,NULL,-1)<0){
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
/* print details about each logical bitstream in the input */
if(ov_seekable(&ov)){
printf("Input bitstream contained %ld logical bitstream section(s).\n",
ov_streams(&ov));
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");
}
for(i=0;i<ov_streams(&ov);i++){
vorbis_info *vi=ov_info(&ov,i);
printf("\tlogical bitstream section %d information:\n",i+1);
printf("\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n",
vi->rate,vi->channels,ov_bitrate(&ov,i)/1000,
ov_serialnumber(&ov,i));
printf("\t\tcompressed length: %ld bytes ",(long)(ov_raw_total(&ov,i)));
printf(" play time: %lds\n",(long)ov_time_total(&ov,i));
}
ov_clear(&ov);
return 0;
}
</b></pre>
</td>
......
......@@ -59,7 +59,7 @@ called to initialize the <a href="OggVorbis_File.html">OggVorbis_File</a> struct
<tr bgcolor=#cccccc>
<td>
<pre><b>
if(ov_open(stdin,&ov,NULL,-1)<0){
if(ov_open(stdin,&ov,NULL,-1)<0){
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
......
......@@ -17,8 +17,8 @@
<p>There are several data structures used to hold file and bitstream information during vorbisfile decoding.
<p>
All the <b>vorbisfile</b> specific data structures are declared in "vorbis/vorbisfile.h" or "vorbis/codec.h".
<p>
<p>When using vorbisfile, we usually won't need to know about most of the contents of these data structures, but it may be helpful to understand what they contain.
<p>
<p>When using vorbisfile, we usually won't need to know about most of the contents of these data structures, but it may be helpful to understand what they contain.
<br><br>
<table border=1 color=black width=50% cellspacing=0 cellpadding=7>
......
......@@ -140,20 +140,20 @@ Here's the read loop:
<td>
<pre><b>
while(!eof){
long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
if (ret == 0) {
/* EOF */
eof=1;
} else if (ret < 0) {
/* error in the stream. Not a problem, just reporting it in
case we (the app) cares. In this case, we don't. */
} else {
/* we don't bother dealing with sample rate changes, etc, but
you'll have to*/
fwrite(pcmout,1,ret,stdout);
}
}
while(!eof){
long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
if (ret == 0) {
/* EOF */
eof=1;
} else if (ret < 0) {
/* error in the stream. Not a problem, just reporting it in
case we (the app) cares. In this case, we don't. */
} else {
/* we don't bother dealing with sample rate changes, etc, but
you'll have to*/
fwrite(pcmout,1,ret,stdout);
}
}
</b></pre>
......
......@@ -17,7 +17,7 @@
<p><i>declared in "vorbis/vorbisfile.h";</i></p>
<p>This function returns the average bitrate for the specified logical bitstream. This may be different from the <a href=ov_info.html>ov_info->nominal_bitrate</a> value, as it is based on the actual average for this bitstream if the file is seekable.
<p>This function returns the average bitrate for the specified logical bitstream. This may be different from the <a href=ov_info.html>ov_info->nominal_bitrate</a> value, as it is based on the actual average for this bitstream if the file is seekable.
<p>Nonseekable files will return the nominal bitrate setting or the average of the upper and lower bounds, if any of these values are set.
<p>
......@@ -44,7 +44,7 @@ functions.</dd>
<h3>Return Values</h3>
<blockquote>
<li>OV_EINVAL indicates that an invalid argument value was submitted.</li>
<li>OV_EINVAL indicates that an invalid argument value was submitted.</li>
<li>OV_FALSE means the call returned a 'false' status, which in this case most likely indicates that the file is nonseekable and the upper, lower, and nominal bitrates were unset.
<li><i>n</i> indicates the bitrate for the given logical bitstream or the entire
physical bitstream. If the file is open for random (seekable) access, it will
......
......@@ -42,7 +42,7 @@ functions.
<blockquote>
<li>
0 indicates the beginning of the file or unchanged bitrate info.</li>
<li><i>n</i> indicates the actual bitrate since the last call.</li>
<li><i>n</i> indicates the actual bitrate since the last call.</li>
<li>OV_FALSE indicates that the call returned a 'false' status. In this case, this error code is returned if playback is not in progress, and thus there is no instantaneous bitrate information to report.</li>
</blockquote>
<p>
......
......@@ -73,13 +73,13 @@ should contain the length (in bytes) of the buffer. Used together with <tt>init
<li>
0 for success</li>
<li>less than zero for failure:</li>
<li>less than zero for failure:</li>
<ul>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</blockquote>
<p>
......
......@@ -69,13 +69,13 @@ should contain the length (in bytes) of the buffer. Used together with <tt>init
<blockquote>
<li>
0 for success</li>
<li>less than zero for failure:</li>
<li>less than zero for failure:</li>
<ul>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</blockquote>
<p>
......
......@@ -50,19 +50,19 @@ functions.</dd>
0 for success</li>
<li>
nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EREAD - A read from media returned an error.
</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack
corruption.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EREAD - A read from media returned an error.
</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack
corruption.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
</ul></blockquote>
<br><br>
<hr noshade>
......
......@@ -17,7 +17,7 @@
<p><i>declared in "vorbis/vorbisfile.h";</i></p>
<p>Seeks to the closest page preceding the specified location (in pcm samples) within the physical bitstream. This function only works for seekable streams.
<p>Seeks to the closest page preceding the specified location (in pcm samples) within the physical bitstream. This function only works for seekable streams.
<p>This function is faster than <a href="ov_pcm_seek.html">ov_pcm_seek</a> because the function can begin decoding at a page boundary rather than seeking through any remaining samples before the specified location. However, it is less accurate.
<p>This also updates everything needed within the
decoder, so you can immediately call <a href="ov_read.html">ov_read()</a> and get data from
......@@ -51,19 +51,19 @@ functions.</dd>
0 for success</li>
<li>
nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EREAD - A read from media returned an error.
</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack
corruption.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EREAD - A read from media returned an error.
</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack
corruption.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
</ul></</blockquote>
<br><br>
<hr noshade>
......
......@@ -41,7 +41,7 @@ functions.</dd>
<h3>Return Values</h3>
<blockquote>
<blockquote>
<li>OV_EINVAL means that the argument was invalid. In this case, the requested bitstream did not exist or the bitstream is unseekable.</li>
<li>
total length in pcm samples of content if i=-1.</li>
......
......@@ -48,14 +48,14 @@ struct should be passed to all the vorbisfile functions.</dd>
<blockquote>
<li>
0 indicates success</li>
<li>nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
<li>nonzero indicates failure, described by several error codes:</li>
<ul>
<li>OV_ENOSEEK - Bitstream is not seekable.
</li>
<li>OV_EINVAL - Invalid argument value.
</li>
<li>OV_EBADLINK - Invalid stream section supplied to libvorbis/libvorbisfile, or the requested link is corrupt.
</li>
</ul>
</blockquote>
<p>
......
......@@ -60,13 +60,13 @@ should contain the length (in bytes) of the buffer. Used together with <tt>init
<li>
0 for success</li>
<li>less than zero for failure:</li>
<li>less than zero for failure:</li>
<ul>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</blockquote>
<p>
......
......@@ -60,13 +60,13 @@ should contain the length (in bytes) of the buffer. Used together with <tt>init
<blockquote>
<li>
0 for success</li>
<li>less than zero for failure:</li>
<li>less than zero for failure:</li>
<ul>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</blockquote>
<p>
......
......@@ -46,13 +46,13 @@ struct should be passed to all the vorbisfile functions.</dd>
<li>
0 for success</li>
<li>less than zero for failure:</li>
<li>less than zero for failure:</li>
<ul>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
<li>OV_EREAD - A read from media returned an error.</li>
<li>OV_ENOTVORBIS - Bitstream is not Vorbis data.</li>
<li>OV_EVERSION - Vorbis version mismatch.</li>
<li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
<li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
</ul>
</blockquote>
<p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment