Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: freeze on ov_open (Read 4217 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

freeze on ov_open

I'm new to Ogg and tried 3 different demo sources to just open a file, and all of them have the same problem: they freeze at ov_open and I'm forced to end-task the app. All dll's and so forth are included and it links fine, and the file is definately found by fopen. 

FILE*  oggFile;
OggVorbis_File  oggStream;

if(!(oggFile = fopen(path, "rb")))
    throw "Could not open Ogg file.";
if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0)
{
    fclose(oggFile);
    throw "Could not open Ogg stream. ";
}

freeze on ov_open

Reply #1
how about memset(&oggStream,0,sizeof(oggStream)); first
Microsoft Windows: We can't script here, this is bat country.

freeze on ov_open

Reply #2
That was quick! I tried your suggestion but it still hangs. 

freeze on ov_open

Reply #3
Might if have something to do with which libraries I'm including? Should I go debug, normal, or static?

freeze on ov_open

Reply #4
Are you using libvorbis in DLL form ? Perhaps linking statically would solve the problem (different compilers / compiler settings, your FILE* doesn't work in libvorbis).
Another solution would be to use ov_open_callbacks instead, that would workaround the problem as well.
Microsoft Windows: We can't script here, this is bat country.

freeze on ov_open

Reply #5
Try this:

if(ov_open(oggFile, &oggStream, NULL, 0) < 0)

freeze on ov_open

Reply #6
Still no dice. I'll have to try callbacks. Figuring out how to do that now.

freeze on ov_open

Reply #7
Callback appeared to work. I don't have any sound playing, however, as now OpenAL is crashing the program. But at least it got passed 'open'. Thanks!

 

freeze on ov_open

Reply #8
Ogg Vorbis works! Again, thanks a bunch!