[vorbis] [BUG] libvorbisfile ov_test() ?

Gniazdowski Mariusz refuse at wp.pl
Tue Jul 23 13:22:31 PDT 2002



The folowing code donst work:

#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
        FILE *stdfile;
        OggVorbis_File vf;
        int tmp;

        stdfile=fopen("./test.ogg","r");
        if( ov_test(stdfile, &vf, NULL, 0) ==0)
        {
                tmp = ov_test_open(&vf);
                if( tmp==0 )
                {
                        printf("ov_test_open() succeded\n");
                        ov_clear(&vf);
                        return(0);
                }
                printf("fail in ov_test_open(), reason: %d\n",tmp);
                printf("vf.ready_state is: %d\n",vf.ready_state);
                ov_clear(&vf);
                return(0);
        }
}

<p><p>Maybe i wrong understand docs and idea of ov_test() / ov_test_open() ?

Src of ov_test_open:
int ov_test_open(OggVorbis_File *vf){
  if(vf->ready_state!=PARTOPEN)return(OV_EINVAL);
  return _ov_open2(vf);
}

It returns OV_EINVAL when i run upper example:
# ./a.out
fail in ov_test_open(), reason: -131
vf.ready_state is: 3
 
When i use ov_open directly, it works.


-- 
Mariusz Gniazdowski.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis mailing list