Ogg Vorbis ov_open() crashing, not returning anything

Started by
3 comments, last by Kibble 19 years, 6 months ago
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).
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.
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?)
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.
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]

This topic is closed to new replies.

Advertisement