[Vorbis] ov_open_callbacks() performance & memory requirements

Michael Smith msmith at xiph.org
Thu Sep 14 07:57:45 PDT 2006


On 9/14/06, Dave Brown <dave at db-audioware.com> wrote:
> Hi guys,
>
> I'm writing a sample playback engine using vorbisfile, but I've hit a
> performance problem - hoping someone here can help!
>
> I'm using ov_open_callbacks() to decode memory-based ogg files. It works
> OK, but when I call ov_open_callbacks() approximately 300k of memory is
> used (presumably to initialise the decoder). It also takes some time to
> execute ov_open_callbacks() - the read & seek functions are being called
> a huge number of times, even for a tiny 10k ogg file.

If you have very small files, perhaps you're not interested in being
able to seek around them. Returning failure from your seek callback is
fine, and will disable seeking; that'll probably speed things up
somewhat.

As for memory use: not much you can do with that implementation, the
libvorbis decoder is simply fairly memory-intensive. You could look at
changing to use the tremor-lowmem vorbis decoder, which is
specifically designed to minimise memory use.

Mike


More information about the Vorbis mailing list