[Vorbis-dev] how to delete all comments?

David M. Cotter dave at kjams.com
Wed Feb 7 16:03:11 PST 2007


okay all i want to do now is just DELETE any and all comments from a  
file.  here's what I do:

//	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);	<-- is this the correct way??
vorbis_comment_init(i_commentsP);  <-- do i need to do this since  
it's already clear??

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

however, this does not delete the comments.  here's what my file  
looks like AFTER running the above code: (non-ascii stuff deleted so  
you can see what's there)

OggS
vorbis
OggS
vorbis
Xiph.Org libVorbis I 20020717
TITLE=
ARTIST=Buddy Holly
ALBUM=Unknown Album
GENRE=Rock
TRACKNUMBER=
YEAR=1982
SOFTWARE=kJams Producer
TOTALTRACKS=
COPYRIGHT=
DESCRIPTION=
PERFORMER=
LICENSE=
COMPOSER=
DATE=
LOCATION=
CONTACT=
ISRC=
vorbis

how the heck do I delete the old comments??  and i mean utterly  
remove them, including removing the keys, not just the values.




More information about the Vorbis-dev mailing list