[Vorbis-dev] an excecute error

Ralph Giles giles at xiph.org
Sat Nov 27 12:51:02 PST 2004


On Sat, Nov 27, 2004 at 01:37:31PM -0700, apoyomutuo at spymac.com wrote:

> this it is the first time that I program with ogg libraries (I am a beginner).  
> it has happened me an error, the code is the following one:
> /*********************************************/
> OggVorbis_File  *musica=NULL;
> FILE *archiv =NULL;
> 
> archiv = fopen("prueba.ogg","r");
> if(archiv==NULL) 
> 	exit(0);
> int falla = ov_open(archiv,musica,NULL,0);//aca se produce el error
> /*********************************************************************/

Two things I notice that are wrong:

Ogg Vorbis is a binary format, so you should call fopen() with "rb" on 
windows.

You are also passing a NULL value for musica, but this is where
ov_open() expects to store its decoder context. You must allocate
a structure and and pass its address instead of NULL. This is
likely the origin of the access violation.

Hope that helps,
 -r


More information about the Vorbis-dev mailing list