[vorbis] ov_read not returning amount requested

Michael Smith msmith at labyrinth.net.au
Tue Mar 6 23:59:44 PST 2001



At 04:26 PM 3/7/01 +1300, you wrote:
>When I am using vorbisfile on a disk file, ov_read does not always (in
>fact - most of the time) read the number of bytes I request.
>It doesn't seem to be dependent on the number I ask for, and the ratio
>between what I request and what is read varies.
>Can somebody tell me what's going on here?

It's behaving as intended (and as documented).
It's better to think of that number as being 'size of buffer' rather than
'how much data I want' - vorbisfile will then fill some part of the buffer,
guaranteed not to be more than the amount of space present. It won't 
typically fill the entire buffer, though. 

The right thing to do if you need to fill the entire buffer is to loop over
the ov_read() call until your buffer is full. In many cases, though, this 
isn't (directly) neccesary.

Michael

--- >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-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list