[Vorbis] Having problems with ov_read

Ralph Giles giles at xiph.org
Wed Jun 14 12:42:14 PDT 2006


On Wed, Jun 14, 2006 at 04:41:57PM +0000, Jeremy Henry wrote:

> Ok here is the breakdown.  I am trying to impliment streaming into our game 
> using openAL and ogg-vorbis.  In the non-streaming function when I call 
> ov_read on the file I should be streaming the buffer gets filled with the 
> correct data.  However, when I run ov_read on the same OggVorbis_File when 
> I read the buffer gets filled with 0's.  The buffer has not been zero'd and 
> starts filled with chode.  I even went as far as ignoring the 
> OggVorbis_File I create in a previous function, pass the FILE* myself and 
> call the ov_open function locally.  Still ov_open returns 0 indicating a 
> successful open and result is coming back at around 2k in data on the first 
> pass but always 0's.

I can't think of anything immediately that would cause ov_read() to 
return spurious zeros. Without seeing more of what you're doing I
can't offer any direct advice.

Some common things to check though: Make sure you're checking all your
return codes in case there's a decoding error. Also, ov_read() will 
generally only return one packet's worth of data per call, regardless of 
how much compressed data you have submitted. Remember that once you've 
ov_open()'d a FILE* the library takes owner ship you should shouldn't
perform any other manipulations on it.

HTH,
 -r


More information about the Vorbis mailing list