Jump to content
  • Advertisement
Sign in to follow this  
tebriel

Ogg Vorbis ov_open() crashing, not returning anything

This topic is 5044 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have some code here that's crashing during ov_open(), it's not returning any error codes. I've tried zeroing out the "oggFile" struct as suggested in an older thread with the same problem--no help. Ogg V is being used alongside SDL and OpenAL in this Multithreaded DLL project. The output SDL is spitting out says there's a segmentation fault. :( Anyone else had a problem similar to this? The *f is definitely not getting set to NULL or it'd never reach ov_open(). The .ogg file it's loading plays fine in Winamp--(in fact I downloaded it from the Ogg Vorbis website)--anyone have any ideas?
bool LoadOgg(const char *fileName, ALuint *buffer) {

... (unrelated data)

  FILE *f;

  OggVorbis_File oggFile;

  // Open for binary reading
  f = fopen(fileName, "rb");
  if (!f) {
    return false;
  }

  ov_open(f, &oggFile, NULL, 0); <--Dies here, does not return anything :(

...
}

Edit: Oh, I'm linking to vorbis_d.lib and vorbisfile_d.lib (I've also tried the non debug versions).

Share this post


Link to post
Share on other sites
Advertisement
I don't know, but I've run across similar oggfile crash with no error bugs [albeit in ov_read].

For now I don't need looping skipping background music so I commented it out of my project.

Share this post


Link to post
Share on other sites
It's funny, I've seen other people (from a long time ago) post the same problem, but never seen a solution other than "use the callback version"--not to be ingrateful for a nice free library like this, but that's just not a solution.

Well... I have found a solution, kindof. Try using the static version of the vorbis library. I compiled the current version of the static library, linked to that, and it's working. (Although loading files very slow but I think that's the nature of the lib and why they say to use a separate thread?)

Share this post


Link to post
Share on other sites
oh yes, I did have to use that "Set the callbacks" workaround as described in a thread in the sound/music forum. Worked fine with that. But yes, it's fairly inexcusable.

Share this post


Link to post
Share on other sites
Try using the _static version of the libs. I know its lame, but that is how I stopped this from happening. I ended up using the callback version later anyways so I can't gaurentee that is how I fixed it, but I believe that was it.

edit: I should learn to read.

[Edited by - Kibble on October 1, 2004 3:39:08 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!