<tr bgcolor=#cccccc>
<td>
<pre><b>
- if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<0){
+ if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<0){
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
<tr bgcolor=#cccccc>
<td>
<pre><b>
- if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+ if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
exit(1);
}
<td>
<pre><b>
{
- char **ptr=ov_comment(&vf,-1)->user_comments;
- vorbis_info *vi=ov_info(&vf,-1);
+ char **ptr=ov_comment(&vf,-1)->user_comments;
+ vorbis_info *vi=ov_info(&vf,-1);
while(*ptr){
fprintf(stderr,"%s\n",*ptr);
++ptr;
}
- fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+ fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
fprintf(stderr,"\nDecoded length: %ld samples\n",
- (long)ov_pcm_total(&vf,-1));
- fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+ (long)ov_pcm_total(&vf,-1));
+ fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
}
</b></pre>
<pre><b>
while(!eof){
- long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+ long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
if (ret == 0) {
/* EOF */
eof=1;
- } else if (ret < 0) {
+ } 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 {
<td>
<pre><b>
- ov_clear(&vf);
+ ov_clear(&vf);
fprintf(stderr,"Done.\n");
return(0);
<td>
<pre><b>
-#include <stdlib.h>
-#include <stdio.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
#endif
/* open the file/pipe on stdin */
- if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
+ if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
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)){
- double length=ov_time_total(&ov,-1);
+ if(ov_seekable(&ov)){
+ double length=ov_time_total(&ov,-1);
printf("testing seeking to random places in %g seconds....\n",length);
- for(i=0;i<100;i++){
+ for(i=0;i<100;i++){
double val=(double)rand()/RAND_MAX*length;
- ov_time_seek(&ov,val);
+ ov_time_seek(&ov,val);
printf("\r\t%d [%gs]... ",i,val);
fflush(stdout);
}
printf("Standard input was not seekable.\n");
}
- ov_clear(&ov);
+ ov_clear(&ov);
return 0;
}
<td>
<pre><b>
-#include <stdlib.h>
-#include <stdio.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
#endif
/* open the file/pipe on stdin */
- if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
+ if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)==-1){
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)){
- double length=ov_time_total(&ov,-1);
+ if(ov_seekable(&ov)){
+ double length=ov_time_total(&ov,-1);
printf("testing seeking to random places in %g seconds....\n",length);
- for(i=0;i<100;i++){
+ for(i=0;i<100;i++){
double val=(double)rand()/RAND_MAX*length;
- ov_time_seek(&ov,val);
+ ov_time_seek(&ov,val);
printf("\r\t%d [%gs]... ",i,val);
fflush(stdout);
}
printf("Standard input was not seekable.\n");
}
- ov_clear(&ov);
+ ov_clear(&ov);
return 0;
}
<tr bgcolor=#cccccc>
<td>
<pre><b>
- if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+ if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
exit(1);
}
<td>
<pre><b>
{
- char **ptr=ov_comment(&vf,-1)->user_comments;
- vorbis_info *vi=ov_info(&vf,-1);
+ char **ptr=ov_comment(&vf,-1)->user_comments;
+ vorbis_info *vi=ov_info(&vf,-1);
while(*ptr){
fprintf(stderr,"%s\n",*ptr);
++ptr;
}
- fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
- fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+ fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+ fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
}
</b></pre>
<pre><b>
while(!eof){
- long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+ long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
switch(ret){
case 0:
/* EOF */
<td>
<pre><b>
- ov_clear(&vf);
+ ov_clear(&vf);
fprintf(stderr,"Done.\n");
return(0);
_setmode( _fileno( stdout ), _O_BINARY );
#endif
- if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
+ if(ov_open_callbacks(stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
exit(1);
}
{
- char **ptr=ov_comment(&vf,-1)->user_comments;
- vorbis_info *vi=ov_info(&vf,-1);
+ char **ptr=ov_comment(&vf,-1)->user_comments;
+ vorbis_info *vi=ov_info(&vf,-1);
while(*ptr){
fprintf(stderr,"%s\n",*ptr);
++ptr;
}
- fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
- fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+ fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+ fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
}
while(!eof){
- long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);
+ long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
if (ret == 0) {
/* EOF */
eof=1;
- } else if (ret < 0) {
+ } 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 {
}
}
- ov_clear(&vf);
+ ov_clear(&vf);
fprintf(stderr,"Done.\n");
return(0);