[vorbis-dev] Re: Detailed decoder pseudocode

Monty xiphmont at xiph.org
Tue Oct 5 09:47:55 PDT 1999



> Aack, boy was I off.

Apologies.  I *really* need to put up more information about the state of that
code.

(I just flew back to San Jose and am putting some time into catching up in
general.  The servers all stayed up after three weeks unattended although I did
lose two cooling fans :-)

> Is there such a function as vorbis_info_destroy()?

Yes; vorbis_info_clear(), which appeared in one of this week's CVS commits.  
I've still got one or two places to make the style 100% consistent, but 
everything is following the naming pattern.

The destructor-type functions are named '_clear' instead of '_destroy' because 
they don't free the pointer passed into them.  This way you can use stack 
storage for the structs (like in the example code). If you want to free the 
pointer too, call _clear() followed by free().

> It seems like it
> would follow the rest of the library stylalisticly (and is necessary to
> avoid memory leaks, afaict...)

I'm getting to cleaning up the random typos in the example I sent.  I have a
more complete version of the example committed to CVS as vorbis/lib/
decoder_example.c and vorbis/lib/encoder_example.c.  These compile (and would
run, but I have a couple days more filling in to do in vorbis_analysis() and
vorbis_synthesis() before they run).

Aside from any typos that persist, the examples should leak no memory.

Monty

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list