[Vorbis-dev] ov_open_callbacks

Michael Smith msmith at xiph.org
Wed Sep 7 11:24:43 PDT 2005


On 9/7/05, Tony O'Bryan <TO'Bryan at greenecountymo.org> wrote:
> Is my program expected to provide the datasource and other parameters to the
> OggVorbis_File structure before calling ov_open_callbacks?  Or are my
> callback functions expected to maintain state themselves?

The 'datasource' pointer is something supplied by you (you pass it in
in ov_open_callbacks), in which you should store any/all state you
need. It's a void pointer, you'd normally use it like this:

struct my_state {
  something foo;
};

my_read_callback(void *datasource, ...) {
  struct my_state *state = (struct my_state *)datasource;
  ...;

}
etc.



Mike


More information about the Vorbis-dev mailing list