[Vorbis] ov_read, callbacks and 0 bytes read

Michael Smith msmith at xiph.org
Fri Oct 6 01:36:03 PDT 2006


On 10/6/06, Andrew Lentvorski <bsder at allcaps.org> wrote:
> How does one deal with the case when an fread callback doesn't have any
> more data but is going to get more data in the future?
>
> In particular, this is an issue when reading an incoming Ogg stream from
>   a socket (icecast2, in this case).
>
> The issue is that the fread can't return 0 (that signals EOF and hoses
> everything), and it doesn't have a negative code that says come back
> later when you have more data.
>
> I can't allow this to block as the system I am using does not have
> threads (embedded system).

Vorbisfile is a high-level interface. It's very easy to use if your
design matches what it provides... but if it doesn't, it's pretty
useless.

In your case, I guess it falls into the 'pretty useless' category.
You'd be MUCH better off just starting from the lower-level libvorbis,
and writing your own higher-level API that can have appropriately
non-blocking semantics.

You simply can't do what you want with vorbisfile; adding it would be difficult.

Mike


More information about the Vorbis mailing list