Hey, I've coded an OGG player for Win32 (it uses AL for playback so it's portable to Linux/Mac), but every time the program gets to the 'ov_open()' function, the app completely freezes, and I have to use the task-manager to kill it. I am supplying it with a valid file handle that was just opened (FILE*) and the vorbis file is also a pointer that is not in use (set to null). Any ideas why this is happenening? Here is my actual source. FILE *SoundFile; OggVorbis_File *OVFile; if(SoundFile != NULL) CloseOGG(); if((SoundFile = fopen(Filename, "rb")) == NULL) return false; if((ov_open(SoundFile, OVFile, NULL, 0)) < 0) return false; I've put debug messages that my log-class logs, and it logs everything just fine up to the ov_open() check, then nothing. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Most likely is that your application is using the Singlethreaded runtime libraries and the ogg and vorbis libs are compiled against the multithreaded runtime libs. Check that and see if that fixes your crash. Jon Ryan Ashley wrote:> Hey, I've coded an OGG player for Win32 (it uses AL for playback so > it's portable to Linux/Mac), but every time the program gets to the > 'ov_open()' function, the app completely freezes, and I have to use > the task-manager to kill it. I am supplying it with a valid file > handle that was just opened (FILE*) and the vorbis file is also a > pointer that is not in use (set to null). Any ideas why this is > happenening? Here is my actual source. > > FILE *SoundFile; > OggVorbis_File *OVFile; > > if(SoundFile != NULL) > CloseOGG(); > > if((SoundFile = fopen(Filename, "rb")) == NULL) > return false; > if((ov_open(SoundFile, OVFile, NULL, 0)) < 0) > return false; > I've put debug messages that my log-class logs, and it logs everything > just fine up to the ov_open() check, then nothing. ><p><p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Mon, Feb 09, 2004 at 02:49:09PM -0500, Ryan Ashley wrote: [snip]> OggVorbis_File *OVFile;[snip]> if((ov_open(SoundFile, OVFile, NULL, 0)) < 0) > return false;Umm, OVFile could be pointing anywhere when you pass it to ov_open. I think you mean: } OggVorbis_File OVFile; } } if((ov_open(SoundFile, &OVFile, NULL, 0)) < 0) } return false; See also vorbisfile_example.c in the libvorbis examples directory. Hope this helps, Tom. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Tuesday 10 February 2004 06:49, Ryan Ashley wrote:> Hey, I've coded an OGG player for Win32 (it uses AL for playback so it's > portable to Linux/Mac), but every time the program gets to the 'ov_open()' > function, the app completely freezes, and I have to use the task-manager to > kill it. I am supplying it with a valid file handle that was just opened > (FILE*) and the vorbis file is also a pointer that is not in use (set to > null). Any ideas why this is happenening? Here is my actual source. > > FILE *SoundFile; > OggVorbis_File *OVFile;This is wrong, you only have a pointer to the struct here, no actual struct. So you need to allocate some storage for it. You can stack-allocate this with OggVorbis_File OvFile;> > if(SoundFile != NULL) > CloseOGG();This is wrong, you haven't opened the file yet - you need to do this later (after the fopen()).> > if((SoundFile = fopen(Filename, "rb")) == NULL) > return false; > > if((ov_open(SoundFile, OVFile, NULL, 0)) < 0) > return false;And here, you need to actually pass a pointer to an OggVorbis_File, not just a pointer that doesn't point to anything at all. Given the suggestion above, this becomes: if((ov_open(SoundFile, &OVFile, NULL, 0)) < 0) return false;> > I've put debug messages that my log-class logs, and it logs everything just > fine up to the ov_open() check, then nothing.Why it's hanging here I don't know - given your code, I'd expect it to just crash. Perhaps Jon's suggestion that you're using the wrong libraries is correct? Also, make sure you have version 1.0.1 of the libraries - version 1.0 had some bugs that could, for certain unusual streams (mostly very short ones, i think) cause some hangs. Mike <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.