[vorbis] ov_read not returning amount requested

Lance lbp1 at cs.waikato.ac.nz
Thu Mar 8 01:31:20 PST 2001



----- Original Message -----
From: "Monty" <xiphmont at xiph.org>
To: <vorbis at xiph.org>
Sent: Thursday, 8 March 2001 08:20 am
Subject: Re: [vorbis] ov_read not returning amount requested

>
>
>
> On Wed, Mar 07, 2001 at 04:18:53AM +0000, Rik Hemsley wrote:
> > #if Lance
> > > 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?
> >
> > On a multiprocessing system, another task may be requesting resources
> > such as the disks at the same time as yours. Unless you're running
> > as a realtime process, the kernel will, at some point, stop your
> > process running, and give time to another. This means that you don't
> > get all the bytes you requested during a single read() operation.
> > Just keep asking until you have enough.
>
> That has nothing to do with it in this case.  ov_read decodes, at
> most, one complete vorbis packet to audio behund the scenes per call,
> and that determines the maximum amount of data returned.  This is to
> avoid wastefull buffering within vorbis/vorbisfile.
>
> Monty

Thanks Monty :)
The doc page for ov_read doesn't make that clear (as I read it ). In fact,
it says
"n indicates actual number of bytes read. Within a logical bitstream, the
number should equal length. At the end of a logical bitstream, the number of
bytes read will equal the remaining number of bytes in the bitstream. "
Perhaps it should be noted that the amount to be read is not guaranteed?

Lance

--- >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