Until now, the largest ogg file I ever decoded was about 15 kb. Now I am
trying to decode files that are
approximated 2 to 3 times larger, and the program is crashing. Could
someone point out my problem?
vorbis_info *vi = ov_info(&vf,-1);
memset(&m_Format, 0, sizeof(m_Format));
m_Format.cbSize = 0;
m_Format.nChannels = vi->channels;
m_Format.wBitsPerSample = 16;
m_Format.nSamplesPerSec = vi->rate;
m_Format.nAvgBytesPerSec = m_Format.nSamplesPerSec * m_Format.nChannels *
2;
m_Format.nBlockAlign = 2 * m_Format.nChannels;
m_Format.wFormatTag = 1;
int eof = 0;
int current_section;
while(!eof)
{
long bytes_read = ov_read(&vf, m_lpData + dwBufferLength, 4096, 0, 2, 1,
¤t_section);
if(bytes_read == 0)
// EOF
eof = 1;
else
dwBufferLength += bytes_read;
}