Help - Search - Members - Calendar
Full Version: ogg/vorbis win32 sdk problem
Hydrogenaudio Forums > Lossy Audio Compression > Ogg Vorbis > Ogg Vorbis - Tech
RogerDV
I have a very simple code to load an ogg file, it works ok under linux, but when used in windows it causes a crash at ov_open. I havent found any clue about what can be the origin of the problem.
Here is the code I use:

CODE
int result;
    
    if(!(oggFile = fopen(path.c_str(), "rb")))
        throw string("Could not open Ogg file.");

    if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0)
    {
        fclose(oggFile);

        throw string("Could not open Ogg stream. ") + errorString(result);
    }


Can somebody give me an idea?
john33
Does this help? (From the vorbisfile documentation.)
QUOTE
ov_open

declared in "vorbis/vorbisfile.h";

ov_open is one of three initialization functions used to initialize an OggVorbis_File structure and prepare a bitstream for playback.

WARNING for Windows developers: Do not use ov_open() in Windows applications; Windows linking places restrictions on passing FILE * handles successfully, and ov_open() runs afoul of these restrictions [a]. See the ov_open_callbacks() page for details on using ov_open_callbacks() instead.

However, I know from personal experience it works fine in console apps and it also works fine in oggdropXPd.
RogerDV
I missed thet in the docs. I will try today, thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.