[Vorbis] Why does ov_open fail?

Wan-Hi online at wan-hi.de
Mon May 23 16:16:51 PDT 2005


hello everyone.

after reading through the api manual of the ogg vorbis win32 sdk, i 
tried to implement a very simple comment reader in visual c++. but for 
some reason the very first operation to initialize the OggVorbis_File 
struct keeps failing and i can't figure out why. is there anything i 
might not have considered? The memory exception seems to happen deep 
within the calling tree of ov_open, in some operation that ms seemed to 
have implemented. but i believe i followed all rules (binary mode and so 
on), so this should not happen. i hope, someone can give me a hint.

thanks.

wan-hi

void ProcessOGG(LPCTSTR pFilePath, MetaData& data)
{
    OggVorbis_File    vf;
    vorbis_info            *info;
    vorbis_commen     *comment;

    
///////////////////////////////////////////////////////////////////////////
    // 1) OPENING AND INITIALIZING THE OGG VORBIS FILE
    
///////////////////////////////////////////////////////////////////////////

    //Let's open the file in binary mode for reading.
    if (_topen(pFilePath, _O_RDONLY | _O_BINARY) == -1)
    {
        data.valid = false;
        return;
    }

    // Let's initialize the OggVorbis_File.
    if(ov_open(stdin, &vf, NULL, 0) < 0)
    {
        _close(0);
        data.valid = false;
        return;
    }
.....
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20050524/5f9b613b/attachment.html


More information about the Vorbis mailing list