[Vorbis] Edting or Adding New Comments

pavan kumar pavanchikkala at yahoo.co.in
Fri Dec 2 04:08:26 PST 2005


Hi Ian,
   
  Thanks for the prompt reply.
  I am writing OggVorbisRecordController for Symbian using libogg and libvorbis libraries. I am not using any specific tools but using libvorbis to generate the vorbis headers and writing them into the file.
  From what you are saying, I understand that I need to rewrite the whole file(incase there is no padding) if i have to add a new entry in the vorbis_comments, because the headers may overwrite the data. 
Please suggest me if I am correct. 
  Also where can i find the code which does this edit/overwrite comments? or which API in libvorbis do i need to use?
   
  regards,
  Pavan.
   
  
Ian Malone <ibm21 at cam.ac.uk> wrote:
  pavan kumar wrote:
> Hi All,
> 
> Can I update the header of the already existing Ogg-Vorbis file with
> the new comments? When we add new entries in the header, will it not
> overwrite the data? does the vorbis library takes care of this? can
> someone also please give me the call sequence on how i can do that?
> 
> Thanks in advance.
> 
> regards, Pavan.
> 
> 

It depends what you mean. If you are talking about the vorbiscomment
utility then there is a (over-)write (-w) and an append(-a) option.
If you look at the vorbiscomment source it is built around vcedit.c
which you can use to load and edit the comment header as you like.
At the moment when writing comments using vcedit you must rewrite
the entire file through if the pages containing the headers have
changed size (because they come at the start).

There is provision to add padding so that you can maintain the page
size and so only need to rewrite the start of files which are padded,
but it's not currently done. Also, for reasons I don't quite
understand, vcedit does a packet copy on the remainder of the stream
rather than the simpler page copy.

-- 
imalone
_______________________________________________
Vorbis mailing list
Vorbis at xiph.org
http://lists.xiph.org/mailman/listinfo/vorbis
  


		
---------------------------------
 Enjoy this Diwali with Y! India Click here
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20051202/1e1b1f38/attachment.htm


More information about the Vorbis mailing list