[Vorbis-dev] how to delete all comments?

Ralph Giles giles at xiph.org
Wed Feb 7 16:14:24 PST 2007


On Wed, Feb 07, 2007 at 04:03:11PM -0800, David M. Cotter wrote:

> //	now delete all existing comments
> vorbis_comment_clear(i_commentsP);	<-- is this the correct way??

Yes, this deallocates the currently stored comments and clears the 
structure

> vorbis_comment_init(i_commentsP);  <-- do i need to do this since  
> it's already clear??

It's redundant in the current implementation, but the vorbiscomment code 
does this, so I'd leave it in in case of future changes.

> //	now update the changes, is this correct??
> vcedit_write(i_vcStateP, i_fileP);

Maybe you should be writing to o_fileP? writing to the same file you're 
reading from may not work.

HTH,
 -r


More information about the Vorbis-dev mailing list