[Vorbis-dev] Delete / replace comments?

David M. Cotter dave at kjams.com
Mon Jan 29 21:21:42 PST 2007


I've tried for a while now to delete and/or replace some comments in  
a file.
I'm using the vcedit.c code

here's what I try:

//	open the file and get access to comments
vcedit_open(i_vcStateP, i_fileP);
i_commentsP = vcedit_comments(i_vcStateP);

//	now delete all existing comments
vorbis_comment_clear(i_commentsP);
vorbis_comment_init(i_commentsP);

//	now in here add some new comments
vorbis_comment_add_tag(
	i_commentsP,
	const_cast<char *>(Key_CommonToCustom(common)),
	const_cast<char *>(str.utf8Z()));

//	now update the changes
vcedit_write(i_vcStateP, i_fileP);
vcedit_clear(i_vcStateP);

however, all this seems to do is APPEND comments, rather that delete  
and create new ones.

how the heck do I delete the old comments??



More information about the Vorbis-dev mailing list