[Vorbis-dev] lack of detail for exception in ov_open

Steve Russell srussell at innernet.net
Wed Jun 15 22:58:20 PDT 2005


----- Original Message ----- 
From: "Steve Russell" <srussell at innernet.net>
To: <vorbis-dev at xiph.org>
Sent: Wednesday, June 15, 2005 6:05 PM
Subject: Re: [Vorbis-dev] lack of detail for exception in ov_open


> ----- Original Message ----- 
> From: "Steve Russell" <srussell at innernet.net>
> To: "Dimitry Andric" <dimitry at andric.com>
> Sent: Wednesday, June 15, 2005 6:02 PM
> Subject: Re: [Vorbis-dev] lack of detail for exception in ov_open
>
>
>> ----- Original Message ----- 
>> From: "Dimitry Andric" <dimitry at andric.com>
>> To: "Steve Russell" <srussell at innernet.net>
>> Cc: <vorbis-dev at xiph.org>
>> Sent: Wednesday, June 15, 2005 8:25 AM
>> Subject: Re: [Vorbis-dev] lack of detail for exception in ov_open
>> On 2005-06-15 at 06:55:25 Steve Russell wrote:
>>
>>> "Unhandled exception in Room 101.exe (NTDLL.DLL): 0xC0000005: Access 
>>> Violation."
>>
>>> OggVorbis_File vf;
>>>  FILE* pFile;
>>>  pFile = fopen("test.ogg", "rb");
>>>  if(!pFile)
>>>   AfxMessageBox("fopen failed");
>>>  //    here's where I get the exception
>>>  int err = ov_open(pFile, &vf, NULL, 0);
>>
>> If this is your actual code, and the test.ogg file doesn't exist, then
>> it is logical that you get an access violation: you are passing a NULL
>> pointer in the pFile parameter to ov_open.  Don't do that. :)
>>
>> OTOH, if you still get exceptions even when you pass a correct file
>> pointer, then it's quite difficult to see what's going wrong without
>> being able to reproduce it.  Therefore, could you please send the
>> exact source code you're using, if it's not too large (or proprietary
>> ;), or put it up for download somewhere?  Also, the exact versions of
>> the vorbis libraries and/or DLLs you're using would be nice.
> ----------------------
> Okay and thanks.  Here is a summary of what I have to this point . . . .
>
> // AudioFile.cpp: implementation of the CAudioFile class.
>
> #include "stdafx.h"
> #include "Room 101.h"
> #include "AudioFile.h"
> //#include "speex/speex.h" // included in AudioFile.h
> #include "speex\speex_bits.h"
> . . .
> #include "vorbis/codec.h"
> #include "vorbis/vorbisfile.h"
> . . .
> OggVorbis_File vf;
> FILE* pFile;
> pFile = fopen("verdes_2.ogg", "rb");
>
> if(!pFile)
> AfxMessageBox("fopen failed");
> else
> AfxMessageBox("fopen succeeded");
>
> int err = 0;
> err = ov_open(pFile, &vf, NULL, 0);
> if(err == OV_EREAD )
> AfxMessageBox("OV_EREAD error");
> if(err == OV_ENOTVORBIS )
> AfxMessageBox("OV_ENOTVORBIS error");
> if(err == 0)
> ::Beep(1000,20);  // I'd love to hear this
> ov_clear(&vf);
>
> *******
>
> I admit that I do not fully understand what all directories and files I 
> need
> to be using and possibly
> where to locate them.  Presently, I have this arrangement, with "C:\Hand 
> in
> Hand\Room 101\" being
> my exe's directory:
>
> C:\Hand in Hand\Room 101\vorbisfile.dll
> C:\Hand in Hand\Room 101\ogg.dll
> C:\Hand in Hand\Room 101\vorbis.dll
>
> C:\Hand in Hand\Room 101\ogg\config_types.h.in
> C:\Hand in Hand\Room 101\ogg\Makefile.am
> C:\Hand in Hand\Room 101\ogg\Makefile.in
> C:\Hand in Hand\Room 101\ogg\ogg.h
> C:\Hand in Hand\Room 101\ogg\os_types.h
>
> C:\Hand in Hand\Room 101\vorbis\codec.h
> C:\Hand in Hand\Room 101\vorbis\vorbisenc.h
> C:\Hand in Hand\Room 101\vorbis\vorbisfile.dll
> C:\Hand in Hand\Room 101\vorbis\vorbisfile.h
> C:\Hand in Hand\Room 101\vorbis\vorbisfile.lib
>
> Copied to these locations from:
>
> C:\OggVorbis\libogg-1.1
> C:\OggVorbis\libvorbis-1.0.1
>
> I read this from someone else's post:
>
> "Your project should include the project files for the static (or dynamic 
> if
> you prefer) libs of ogg,
> vorbis and vorbisfile; and should be dependent on all of them. You will 
> need
> to provide the paths to the 'ogg/include' dir and the 'vorbis/include' 
> dir,
> and maybe others. I can't remember off the top of my head. "
>
> Can't say I'm comprehending all of that, but certainly wish I was.
---------------
I went to a release build and got a defaultlib "library" conflicts with use 
of other libs; use /NODEFAULTLIB:library" warning.  In Project Settings - 
Object/Library modules, I have specified "vorbis/vorbisfile.lib 
speex/libspeex/libspeex.lib."  So I commented out all of my Speex code (not 
yet implemented), and now -- in my Release version ONLY -- ov_open is 
succeeding. 



More information about the Vorbis-dev mailing list