[vorbis] Ogg in MP4 file, Unexpected result from _vorbis_unpack_books

Michael Smith msmith at labyrinth.net.au
Thu Mar 14 04:19:27 PST 2002



>Can anybody tell me if I'm using the libs in a way they are not suppose to ?
>Is it invalid to hand over the raw ogg_packets the way I do it ?

You may certainly hand over ogg_packets as they are as long as they remain
valid. There are various things you can do to make an existing packet 
become invalid, though (because the libraries are managing their memory
internally rather than forcing the application to do it). You probably
need to make a copy of the packet (i.e. create a new ogg_packet structure,
and make a copy of the data in it).

You're most likely hitting this: calling vorbis_analysis_buffer (which is
called from vorbis_analysis_wrote()) will invalidate the header packets
(it frees the memory associated with the headers). 

Similarly, a non-header packet will become invalidated on a call to one
of the analysis functions (not sure which offhand, but as a general rule:
finish with one packet before you ask libvorbis to produce the next - then
you'll be safe). 

Making copies of the packets isn't terribly efficient, but it's the easy
way to get this stuff working, if this is your problem (it probably is).

Feel free to ask again if this doesn't explain the problems you're having.

<p>Michael

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