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 TITLEARTIST=Buddy Holly ALBUM=Unknown Album GENRE=Rock TRACKNUMBERYEAR=1982 SOFTWARE=kJams Producer TOTALTRACKSCOPYRIGHTDESCRIPTIONPERFORMERLICENSECOMPOSERDATELOCATIONCONTACTISRCvorbis how the heck do I delete the old comments?? and i mean utterly remove them, including removing the keys, not just the values.
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